Search Results

Search found 55 results on 3 pages for 'tween'.

Page 2/3 | < Previous Page | 1 2 3  | Next Page >

  • Animating and moving a draggable shape in KineticJS's dragend event

    - by user3712941
    I would like to animate moving a draggable shape to another position after it has been dragged in KineticJS. I would like to animate the movement of the shape over a period of time (for example, over 1 second). For example, I create a draggable shape and save its initial xy coordinates. I register a "dragend" event on this shape. Then, I drag the shape to a new position. When I release the drag, the dragend event is called. In that event function, I want to animate/ease the shape back to its original position. See my JSFiddle for a complete example: DragSample. (function () { //create variables at global scope var layer; var stage; var triangle; var triangleLastX = 190; var triangleLastY = 120; var tween; function initTween() { tween = new Kinetic.Tween({ node: triangle, duration: 1, easing: Kinetic.Easings.EaseInOut, x: 400, y: 200, }); } this.init = function () { layer = new Kinetic.Layer(); stage = new Kinetic.Stage({ container: 'container', width: 800, height: 600 }); triangle = new Kinetic.RegularPolygon({ x: 190, y: 120, sides: 3, radius: 80, fill: '#00D2FF', stroke: 'black', strokeWidth: 4, draggable: true }); triangle.on('dragstart', function () { triangleLastX = triangle.attrs.x; triangleLastY = triangle.attrs.y; }); triangle.on('dragend', function () { tween.play(); stage.draw(); }); layer.add(triangle); stage.add(layer); initTween (); } window.onload = init(); })(); I have tried doing this several ways. The last way I attempted to do this was using Kinetic's Tween(), however, when I play this Tween from the dragend event handler function, it moves the shape back to its original position immediately (i.e. the position when the drag started), then applies the Tween. Is there any way to achieve animating the movement of a draggable shape to its original position (or any other position for that matter) in dragend using KineticJS?

    Read the article

  • Why are custom events not working for me? (Mootools)

    - by John McCollum
    I've been learning Mootools, but I'm having problems firing custom events. I'm sure it must be something simple, but I can't see it for the life of me. I wrote a simple class to nudge some list items using Fx.Tween. It works perfectly, except that the custom events aren't being triggered, no matter what I try. <script type="text/javascript"> var Pusher = new Class({ Implements: [Events,Options], options: { elements: [] }, initialize: function(options){ this.setOptions(options); this.attachListeners(this.options.elements); }, attachListeners: function(elements){ $$(elements).each(function(el){ $(el).addEvent('mouseover', this.pushIn.bind(el)) .addEvent('mouseout', this.pushOut.bind(el)); }, this); }, pushIn: function(){ this.fireEvent('in'); this.set('tween', {duration: 'short'}); this.tween('paddingLeft', '50px'); }, pushOut: function(){ this.fireEvent('out'); this.set('tween', {duration: 'short'}); this.tween('paddingLeft', '0px'); } }); window.addEvent('domready', function(){ var p = new Pusher({ elements: $$('li') }); p.addEvent('in', function(){ alert('in'); }); p.addEvent('out', function(){ alert('out'); }); }); </script> And in the HTML: <ul id="mylist"> <li>1</li> <li>2</li> <li>3</li> <li>4</li> </ul> I've also tried the following: window.addEvent('domready', function(){ var p = new Pusher({ elements: $$('li'), onIn: function(){ alert('in'); }, onOut: function(){ alert('out'); } }); }); What am I doing wrong?

    Read the article

  • Help needed with Flash AS2 to AS3 conversion, having major problems...

    - by Mat
    Hi all, I have a project i need to update form AS2 to AS3 as i need some of the new functions available for vertical centering of text. My current AS2 code on the time line is as follows. var dataField = _root.dataField; var dataType = _root.dataType; var dataPage = _root.dataPage; var dataVar = _root.dataVar; _root.mc.onRelease = function() { getURL("index.php?page="+dataPage+"&num="+dataNum+"&"+dataType+"="+dataVar, "_self"); }; And my external AS file is as follows. import mx.transitions.Tween; /** * * StandardKey is attached to a movieclip in the library. * It handles the basic button behavior of the keyboard keys. * When each button is placed on the stage, it's instance name * will be the unique ID of the key. * */ class StandardKey extends MovieClip { /////////////////////////////////////// //Stage Elements var highlight:MovieClip; //End Stage Elements var highlightTween:Tween; function StandardKey(Void) { //Repaint the key with 0 alpha highlight._alpha = 0; } function onPress(Void):Void { //Do the highlight animation highlightTween.stop(); highlightTween = new Tween(highlight, "_alpha", mx.transitions.easing.Regular.easeInOut, 100, 0, 10, false); } } Here is my attempt at moving timeline and external AS2 to AS3 Timeline i now have : var dataField = this.dataField; var dataType = this.dataType; var dataPage = this.dataPage; var dataVar = this.dataVar; var dataNum = this.dataNum; _root.mc.onRelease = function() { navigateToURL(new URLRequest("index.php?page="+dataPage+"&num="+dataNum+"&"+dataType+"="+dataVar, "_self")); }; External AS3 i have package { import fl.transitions.Tween; import fl.transitions.easing.*; import flash.display.MovieClip; /** * * StandardKey is attached to a movieclip in the library. * It handles the basic button behavior of the keyboard keys. * When each button is placed on the stage, it's instance name * will be the unique ID of the key. * */ public class StandardKey extends MovieClip { /////////////////////////////////////// //Stage Elements var highlight:MovieClip; //End Stage Elements var highlightTween:Tween; public function StandardKey(Void) { //Repaint the key with 0 alpha highlight._alpha = 0; } public function onPress(Void):void { //Do the highlight animation highlightTween.stop(); highlightTween = new Tween(highlight, "_alpha", fl.transitions.easing.Regular.easeInOut, 100, 0, 10, false); } } } The errors i am currently getting are : Scene 1, Layer 'Label', Frame 1, Line 6 1120: Access of undefined property _root. Scene 1, Layer 'Label', Frame 1, Line 7 1137: Incorrect number of arguments. Expected no more than 1. If any one could help me work this out i would appreciate it very much. Kind regards Mat.

    Read the article

  • targeting sprites from a method in the document class - null object reference

    - by Freddyk
    Hi I am trying to code a flash app entirely in the document class. I am using GestureWorks with a touch screen. When a user essentially presses a button it calls a method that should hide a specific graphic but not the graphic they touched. Essentially I need a way to refer to a graphic on the screen using a method besides 'e.target'. //This code works because it can access 'e.target'. private function photo1SpriteFlickHandler(e:GestureEvent):void { var openTween:Tween = new Tween(e.target, "x", Strong.easeOut, 232, 970, 5, true); } //this code gives me a null object reference because I am using 'photo1Sprite' rather than 'e.target' private function photo1SpriteFlickHandler(e:GestureEvent):void { var openTween:Tween = new Tween(photo1Sprite, "x", Strong.easeOut, 232, 970, 5, true); } //photo1Sprite has already been programatically added to the screen as so: var photo1Sprite = new TouchSprite(); var photo1Loader=new Loader(); photo1Loader.load(new URLRequest("media/photos1/photo1.jpg")); photo1Loader.contentLoaderInfo.addEventListener(Event.COMPLETE,loaderComplete); photo1Sprite.x = 232; photo1Sprite.y = 538; photo1Sprite.scaleX = .3; photo1Sprite.scaleY = .3; photo1Sprite.blobContainerEnabled = true; photo1Sprite.addEventListener(TouchEvent.TOUCH_DOWN, startDrag_Press); photo1Sprite.addEventListener(TouchEvent.TOUCH_UP, stopDrag_Release); photo1Sprite.addChild(photo1Loader); addChild(photo1Sprite); So I can make photo1Sprite react if my method is attached to it directly using 'e.target' but not if I am trying to call it from a method that was called from another element on the screen.

    Read the article

  • AS3: Accessing variable declared on MovieClip's parent

    - by Joel Alejandro
    I have a frame which contains an mcMenubar MovieClip. On the frame, I have this code: import Nem.* import fl.transitions.Tween; import fl.transitions.easing.*; import fl.motion.Color; var pageLoader:SwfLoader = new SwfLoader(root, 199, 144); On the mcMenubar clip, I want to access that same pageLoader instance: var pageFile:String = "page-" + e.target.name.replace(/btn/gi, "").toLowerCase() + ".swf"; this.parent.loadPage("loadertest.swf"); // THIS WON'T WORK // var tweenMove:Tween = new Tween(gfxSelected, "x", Bounce.easeOut, gfxSelected.x, e.target.x, 1, true); currentlySelected = e.target.name; Apparently I'm getting this error: TypeError: Error #1010: A term is undefined and has no properties. at MethodInfo-71() How can I fix this?

    Read the article

  • Fixed timestep and interpolation question

    - by Eric
    I'm following Glenn Fiedlers excellent Fix Your Timestep! tutorial to step my 2D game. The problem I'm facing is in the interpolation phase in the end. My game has a Tween-function which lets me tween properties of my game entites. Properties such as scale, shear, position, color, rotation etc. Im curious of how I'd interpolate these values, since there's a lot of them. My first thought is to keep a previous value of every property (colorPrev, scalePrev etc.), and interpolate between those. Is this the correct method? To interpolate my characters I use their velocity; renderPostion = position + (velocity * interpolation), but I cannot apply that to color for example. So what is the desired method to interpolate various properties or a entity? Is there any rule of thumb to use?

    Read the article

  • 1180: Call to a possibly undefined method addEventListener

    - by Chris
    I'm going through some AS3 training, but I'm getting a weird error... I'm trying to add an event listener to the end of a motion tween in AS. I've created a tween, highlighted the frames, right clicked and copied the tween as AS and pasted it into the movie clip (I think there's a better way to do this, but I'm not sure what it is...) When I try to add the listener to the end of that code, I get the error. Here's my code. import fl.motion.AnimatorFactory; import fl.motion.MotionBase; import fl.motion.Motion; import flash.filters.*; import flash.geom.Point; import fl.motion.MotionEvent; import fl.events.*; var __motion_Enemy_3:MotionBase; if(__motion_Enemy_3 == null) { __motion_Enemy_3 = new Motion(); __motion_Enemy_3.duration = 30; // Call overrideTargetTransform to prevent the scale, skew, // or rotation values from being made relative to the target // object's original transform. // __motion_Enemy_3.overrideTargetTransform(); // The following calls to addPropertyArray assign data values // for each tweened property. There is one value in the Array // for every frame in the tween, or fewer if the last value // remains the same for the rest of the frames. __motion_Enemy_3.addPropertyArray("x", [0]); __motion_Enemy_3.addPropertyArray("y", [0]); __motion_Enemy_3.addPropertyArray("scaleX", [1.000000,1.048712,1.097424,1.146136,1.194847,1.243559,1.292271,1.340983,1.389695,1.438407,1.487118,1.535830,1.584542,1.633254,1.681966,1.730678,1.779389,1.828101,1.876813,1.925525,1.974237,2.022949,2.071661,2.120372,2.169084,2.217796,2.266508,2.315220,2.363932,2.412643]); __motion_Enemy_3.addPropertyArray("scaleY", [1.000000,1.048712,1.097424,1.146136,1.194847,1.243559,1.292271,1.340983,1.389695,1.438407,1.487118,1.535830,1.584542,1.633254,1.681966,1.730678,1.779389,1.828101,1.876813,1.925525,1.974237,2.022949,2.071661,2.120372,2.169084,2.217796,2.266508,2.315220,2.363932,2.412643]); __motion_Enemy_3.addPropertyArray("skewX", [0]); __motion_Enemy_3.addPropertyArray("skewY", [0]); __motion_Enemy_3.addPropertyArray("rotationConcat", [0]); __motion_Enemy_3.addPropertyArray("blendMode", ["normal"]); __motion_Enemy_3.addPropertyArray("cacheAsBitmap", [false]); __motion_Enemy_3.addEventListener(MotionEvent.MOTION_END, hurtPlayer); // Create an AnimatorFactory instance, which will manage // targets for its corresponding Motion. var __animFactory_Enemy_3:AnimatorFactory = new AnimatorFactory(__motion_Enemy_3); __animFactory_Enemy_3.transformationPoint = new Point(0.499558, 0.500000); // Call the addTarget function on the AnimatorFactory // instance to target a DisplayObject with this Motion. // The second parameter is the number of times the animation // will play - the default value of 0 means it will loop. // __animFactory_Enemy_3.addTarget(<instance name goes here>, 0); } function hurtPlayer(event:MotionEvent):void { this.parent.removeChild(this); } I've tried a few places for it, both with the animFactory_Enemy_3 variable and the motion_Enemy_3 variable - getting the same error both times.

    Read the article

  • Why is jQuery so widely adopted versus other Javascript frameworks?

    - by Andrew Moore
    I manage a group of programmers. I do value my employees opinion but lately we've been divided as to which framework to use on web projects. I personally favor MooTools, but some of my team seems to want to migrate to jQuery because it is more widely adopted. That by itself is not enough for me to allow a migration. I have used both jQuery and MooTools. This particular essay tends to reflect how I feel about both frameworks. jQuery is great for DOM Manipulation, but seem to be limited to helping you do that. Feature wise, both jQuery and MooTools allow for easy DOM Selection and Manipulation: // jQuery $('#someContainer div[class~=dialog]') .css('border', '2px solid red') .addClass('critical'); // MooTools $('#someContainer div[class~=dialog]') .setStyle('border', '2px solid red') .addClass('critical'); Both jQuery and MooTools allow for easy AJAX: // jQuery $('#someContainer div[class~=dialog]') .load('/DialogContent.html'); // MooTools (Using shorthand notation, you can also use Request.HTML) $('#someContainer div[class~=dialog]') .load('/DialogContent.html'); Both jQuery and MooTools allow for easy DOM Animation: // jQuery $('#someContainer div[class~=dialog]') .animate({opacity: 1}, 500); // MooTools (Using shorthand notation, you can also use Fx.Tween). $('#someContainer div[class~=dialog]') .set('tween', {duration: 500}) .tween('opacity', 1); jQuery offers the following extras: Large community of supporters Plugin Repository Integration with Microsoft's ASP.NET and VisualStudio Used by Microsoft, Google and others MooTools offers the following extras: Object Oriented Framework with Classic OOP emulation for JS Extended native objects Higher consistency between browsers for native functions support. More easy code reuse Used by The World Wide Web Consortium, Palm and others. Given that, it seems that MooTools does everything jQuery does and more (some things I cannot do in jQuery and I can in MooTools) but jQuery has a smaller learning curve. So the question is, why did you or your team choose jQuery over another JavaScript framework? Note: While I know and admit jQuery is a great framework, there are other options around and I'm trying to take a decision as to why jQuery should be our choice versus what we use right now (MooTools)?

    Read the article

  • Blending animations for more character movements

    - by Noob Saibot
    I am making a hack n slash 3rd person game. And I want the character movements to be more dynamic not like fighting games where you have a moves list. I want to animate tons of different animations and have them "Tween" between each other? Because I want the controls to not be keyboard mouse. I want it to be all keyboard. that way you have up to 10 inputs (All your fingers) to blend and morph animations to create more fluid movements. In the end this will almost be similar to characters typing a phrase or string of keys rather than move forward mouse look click to melee. My question is. Has anyone done this before and would someone go about trying to tween lets say one for key on the keyboard excluding Tab, Caps, R+Shift, L+Shift, Enter, R+Ctrl, L+Ctrl, L+Alt, R+Alt, Windows Key, and Menu. So thats all the numbers, letters and punctuation keys. Thats 46 keys gives me a combination of 46P1 = 5502622159812088949850305428800254892961651752960000000000L (used Python) and with a minimum entry value of 2 keypresses shortening to half. This is not humanly possible to create so many inique animations in one lifetime. But I'm guessing there is a reason this hasn't been done already. Or if I just used 10 basic keys. Maybe ASDF SPACE (RIGHT HAND) 456+0 (LEFT HAND KEYPAD) it would give me 3,628,800 posible unique animations.

    Read the article

  • ActionScript Clean Up

    - by TheDarkIn1978
    i want to deallocate a spriteClass from memory and remove it from the display list. when the spriteClass is instantiated, it creates some of it's own sprites with new tweens and tween events and add them as children. i understand that the tween events must be removed in order for the spritClass to become available for garbage collection, and only afterwards should i nullify the spriteClass, but should i also nullify and remove the spriteClass's sprite children and tweens as well, or does it not matter? essentially i'd like to know if by nullifying the spriteClass it automatically removes all of it's added children and new instantiations like tweens, sprites, rects, whatever, or am i responsible for removing them all and otherwise the spriteClass isn't truly null until i do so?

    Read the article

  • Blending effect on textures

    - by joecks
    Hi i am trying to build screen animation like flickering, interlace, color separation similar to old style malfunctioning Amiga screens. The intended effects are shown in this video. I am using libgdx and I already discovered the universal tween engine, which helps a lot to build transitional animations, but how should I approach those blending effects, any suggestions? I will specify my question once I learned more about libgdx, but maybe you could give me some hints already. Thanks!

    Read the article

  • How do I know which Object I clicked?

    - by Nick
    Here's the deal: I'm working on a personal portfolio in AS3 and I've run into a problem which I can't seem to find a logical answer to. I want everything (well, most of it) to be editable with an XML file, including my menu. My menu is just a Sprite with some text on it and a Tweener-tween, no big deal. But, I forgot to think of a way how I can determine which menu-item I have clicked. This is in my Main.as private function xmlLoaded(e:Event):void { xml = e.target.xml; menu = new Menu(xml); menu.x = 0; menu.y = stage.stageHeight / 2 - menu.height / 2; addChild(menu); } In Menu.as public function Menu(xml:XML) { for each (var eachMenuItem:XML in xml.menu.item) { menuItem = new MenuItem(eachMenuItem); menuItem.y += yPos; addChild(menuItem); yPos += menuItem.height + 3; } } and in my MenuItem.as, everything works - I have a fancy tween when I hover over it, but when I click a menu-item, I want something to appear ofcourse. How do I know which one I clicked? I've tried with pushing everything in an array, but that didn't work out well (or maybe I'm doing it wrong). Also tried a global counter, but that's not working either because the value will always be amount of items in my XML file. Also tried e.currentTarget in my click-function, but when I trace that, all of them are "Object Sprite".. I need something so I can give each a unique "name"? Thanks in advance!

    Read the article

  • using a While loop to control the value of a keyframe in a timeline in Javafx

    - by dragoknight
    i want to create an animation where the ball will move in one of the 4 sectors of a circle randomly.this will happen 5 times.so,i create a while loop(i<5) and call the random function.i then create an if loop and attach some x and y values according to the random fn value.i then create an timeline object inside the while loop and in the key frame value,i use these x and y values.but when i run the program,what happens is that all the values are being created(x and y values seen through println) but only the last x and y value(for i=5)is being rendered in the screen.the animations for the previous values(1<=i<=4)are not being rendered.Please advise where have i gone wrong? public function run(args:String[]) { var i=0; while(i<5) { var z=gety(); println(z); // var relativeTime:Duration=0s; if(z==1) {xbind=120; ybind=80; } else if(z==2) {xbind=120; ybind=120; } else if(z==3) { xbind=80; ybind=120; } else if(z==4) { xbind=80; ybind=80; } var t:Timeline=Timeline{ //time: bind pos with inverse; repeatCount: Timeline.INDEFINITE autoReverse: true keyFrames: [ KeyFrame{ time: 0s values: [ x => 100.0,y => 100.0]}, KeyFrame{time: 2s values:[x => xbind tween Interpolator.LINEAR, y => ybind tween Interpolator.LINEAR,] }, ] }//end timeline i++; t.play(); Thread.sleep(2000); }//end while }

    Read the article

  • Problem: Movie Clip contains just one frame

    - by Doug
    I'm a newbie at Flash, so started playing with a pretty standard code sample: one layer contains a movie clip with a flying rectangle, another layer has a button to control it. All script code is in Main.as file. The rectangle was named square1 through the Property window. Here is the problem: the constructor for Main has a line: square1.stop(); to prevent clip from playing, but it doesn't help - it plays. I know the constructor fires, because it has trace("stuff") in it. The code does check that the stage has been created. What strange is that square1.currentFrame always returns 1, and square1.totalFrames returns 1 as well. The layer has 24 frames on the timeline. I tried a tween with just 2 keyframes, then converted whole tween into frames - same result. I mean, the thing is flying before my eyes, how can it be 1 frame??? I even added a listener: square1.addEventListener(Event.ENTER_FRAME, onFrameChange); The event fires all the time, i.e. the frames change, but currentFrame is still 1. Also, tried to name individual frames and use square1.gotoAndStop("begin") and stuff like that. Nothing helps. I am really stuck with this stupid problem.

    Read the article

  • How do I stop events from bubbling/multiple events with animated mouseovers?

    - by Kurucu
    I noticed a lot of JQuery answers on this, but I'm using MooTools... I have a Table of Contents which uses CSS Fixed positioning to keep it off to the left side, except for 20 pixels. The user hovers their cursor over the 20 pixels, which fires the DIV's mouseover event and the ToC slides fully into the page. When the cursor leaves, the ToC slides back to where it was. $('frameworkBreakdown').addEvents({ 'mouseover': function(event){ event = new Event(event); $('frameworkBreakdown').tween('left', 20); event.stop; }, 'mouseout': function(event){ event = new Event(event); $('frameworkBreakdown').tween('left', (10 - $('frameworkBreakdown').getStyle('width').toInt()) ); event.stop; } }); This works well (aside from unrelated issues) except that when I move the mouse on the DIV it starts to jitter, presumably because the contents of the DIV are also firing the event, or the event refires as the mouse tracks over the DIV. How can I stop this behaviour from occuring? Is there a standard method, or do I use some sort of nast global variable that determines whether effects are in action, and thus ignore the event?

    Read the article

  • Merging Flash animations

    - by Radu
    If I have a Flash project in which there are multiple movie clips animating, each with its own timeline and other embedded movie clips, again, each with its own timeline, how can I merge everything so that I end up with a single timeline and a single layer? If Flash doesn't support this, maybe there's something else out there that can do this? I'm thinking that such a tool would need to calculate the intermediary tween values and somehow create keyframes with those values, then break everything apart and only animate the correct parts from the calculated keyframe values...

    Read the article

  • Is there a way to export all the images of my tweening effect in Flash?

    - by Paul
    i'm using Flash to create the animation of my character in 2D (i'm just beginning). Is it possible to make a tween effect of a character, and then automatically export all the images/frames? So far, it's a bit fastidious : i create my tweening effect, then i put a keyframe for each frame i want to copy and paste, then i select the movieclips and shapes and copy and paste them into another flash document, i position those clips at the exact same location as the previous image, then i erase the previous image and export the image... For 30 frames! Is there any faster way? Thanks

    Read the article

  • Calculating an orbit and approach velocties

    - by Mob
    I have drones in my game that need to approach and orbit a node and shoot at it. Problem is I want to stay away from a real physics simulation, meaning I don't want to give the node and drone a mass and the drone's thrusters' a force. I just want to find the best way to approach and then enter orbit. There was a pretty good answer about using bezier curves and doing it that way, but that is essentially a tween between two fixed points. The nodes are also moving as the drones enter orbit.

    Read the article

  • Problems using easing equations in C# XNA

    - by codinghands
    I'm having some trouble using the easing equations suggested by Robert Penner for ActionScript (http://www.robertpenner.com/easing/, and a Flash demo here) in my C# XNA game. Firstly, what is the definition of the following variables passed in as arguments to each equation? float t, float b, float c, float d I'm currently calculating the new X position of a sprite in the Update() loop, however even for the linear tween equation I'm getting some odd results. I'm using the following values: float t = gameTime.TotalGameTime.TotalMilliseconds; float d = 8000f; float b = x.Position.X; float c = (ScreenManager.Game.GraphicsDevice.Viewport.Width >> 1) - (x.Position.X + x.frameSize.X / 2); And this equation for linear easing: float val = c*t/d + b;

    Read the article

  • Adobe Flash or After Effects: How to make a piece of virtual paper blow away?

    - by Allen G
    About a month ago I saw a portfolio website in Flash that featured a stack of cards, and each time you clicked on it, they sort of blew all over the place, thus exposing the backs as videos and pictures. Although I could easily take a bunch of 3D planes and tween them to turn and flip, these cards actually seemed to 'bend'. How is this effect achieved? Sorry I don't have the link to the example. Thanks!

    Read the article

  • AS3 Transition Manager problem

    - by Mirko
    I am using the TransitionManager class to pixel dissolve an image in an image gallery XML driven. It always stops half way through the animation...I hate Adobe Tween engines, I always used TweenMax without (almost) any problem but I would like to have the pixel dissolve effect. var myTM:TransitionManager = new TransitionManager(container_mc); myTM.addEventListener("allTransitionsOutDone",swapContent); myTM.startTransition({ type:PixelDissolve, direction:Transition.OUT, duration:1,easing:None.easeOut,xSections:200, ySections:200 }); Any suggestion?

    Read the article

  • MooTools: Fade out element?

    - by JamesBrownIsDead
    I have an Element object that I'm currently calling .hide() on. Instead, I'd like to fade out the opacity of the entire Element (and its children) to 100% (hidden) as a transition effect over maybe 500 ms or 1000 ms. Can Fx.Tween be used for this? Is this possible--does the MooTools framework have an effect like this in its UI library?

    Read the article

  • Managing flash animations for a game

    - by LoveMeSomeCode
    Ok, I've been writing C# for a while, but I'm new to ActionScript, so this is a question about best practices. We're developing a simple match game, where the user selects tiles and tries to match various numbers - sort of like memory - and when the match is made we want a series of animations to take place, and when they're done, remove the tile and add a new one. So basically it's: User clicks the MC Animation 1 on the MC starts Animation 1 ends Remove the MC from the stage Add a new MC Start the animation on the new MC The problem I run into is that I don't want to make the same timeline motion tween on each and every tile, when the animation is all the same. It's just the picture in the tile that's different. The other method I've come up with is to just apply the tweens in code on the main stage. Then I attach an event handler for MOTION_FINISH, and in that handler I trigger the next animation and listen for that to finish etc. This works too, but not only do I have to do all the tweening in code, I have a seperate event handler for each stage of the animation. So is there a more structured way of chaining these animations together?

    Read the article

  • DisplayObject.rotation not matching trig functions

    - by futuraprime
    I'm trying to label an animated pie chart, and I've been having a great deal of trouble getting rotated objects to line up with trigonometrically-positioned objects. So, for example, if I have a pie piece that's middle is angle theta and has been rotated n degrees in a tween, and then I try to position a label with code like this: label.x = center.x + Math.cos((theta + n)/180 * Math.PI) * radius; label.y = center.y + Math.sin((theta + n)/180 * Math.PI) * radius; the label is often not aligned with the center of the pie slice. Since I am also zooming in to the pie chart a great deal, the error becomes significant enough that it occasionally causes the label to miss the pie slice altogether. The error seems relatively unpredictable, and it looks a great deal like a rounding error, but I don't see any obvious rounding going on (the trig functions evaluate to ten or so decimal places, which should be more than enough here). How can I get these labels to position correctly?

    Read the article

< Previous Page | 1 2 3  | Next Page >