ActionScript 3.0 :: Tweening 2 Objects From The Center At The Same Time?
Oct 3, 2009
Is there a way to scale up an object from its center even if its registeration point is at the top left? can that be done using TweenMax?2. can I apply the same tween on two objects at the same time? basically what I want to do is load up an image to the stage, and then tween its scale from 0 to the original size along with another movie clip behind it that would form some sort of a border for the image. and I want to scale them up from the center.
I've been working on an interactive map of the counties in Montana. When a user clicks on a county, I'd like the map to zoom to the county's extent and center it on the stage. Every county is a child of a larger container (the state, names allcnt_mc). I've set things up in my function so that when you click on a county POINT variables with all the numbers you need are created. I just cannot get the desired effect and I think I am missing something basic in regards to the geometry of my stage. Can anyone see something I am missing? I set this up so that the parent is tweened to a new location equal to stage center minus the called child's x,y distance from stage center. Essentially, this should center the child over the stage center, no?
function tweenparent(e:MouseEvent):void{ //create vars for x,y cordinates of clicked county (child) var calledx:Number=allcnt_mc[xmlData.row.NAME[e.currentTarget.ivar]].x;
What I want to do is fade out several objects at once and when they finished a special function gets called. Are there other possibilities when using tweenlite available or do I have to use timelinelite?
How to make the objects in your flash move without tweening? example, I have 2 retangles and I want the 1st rectangle to move left and bounce at the edge of the scene. And the 2nd rectangle move to the same direction but not the same speed. Rectangles are: rectangle1 and rectangle2
Is there an easier way to set up 6 different similar tweens? I can't seem to get a "for" loop to work - Each of the nested clips is sitting on the main stage. The following code works, but it's way too long:
I am creating a Twitter to Flash newsticker using a TextBox class. I animate the movement using methods of the TextBox class and TweenLite. The application runs fine, but after about 15 minutes, the tweenings become very sluggish. Anyone that has experience with the drawing API, as I think it is related to clearing / deleting the objects...
I've searched a lot, but still cannot find answer to my problem. I have a dynamic gallery that needs some animation on each item. I tried using AnimatorFactory, but because items are dynamically created it doesn't work. I tried using dictionaries, arrays, but nothing helps. I keep on getting the following error: Code: ReferenceError: Error #1069: Property p_380020857260 not found on packages.lord.Group and there is no default value. Here is a snippet of my code regarding this:
I've recently made the move from Tweener to TweenLite (about time) and am wondering if its possible to pass more than one object into a tween like I could with tweener.
I am making some animations with shape tweening. I actually need it for my presentation.There are five layers of almost same shape of objects. The first two layers and shape tweening works as I expected.But from third layer, something weird happening. As I do shape tween, the layer becomes two moving objects: one is acting as I wish, but the other same object rotaing in x-direction.
i'm having problems tweening 3d objects using the built in fp10 3d engine. i have a timeline tween that i want to create a tweenlite tween from and then duplicate it for other objects. i am using the bezierthrough plugin as well to tween along a path. i have used the motion editor in the ide to copy all values that change along the path into a tweenlite instance as follows:
I would like to know if I can get an error or some other problems when I try to tween several objects like this and using an onComplete-property:[code]:What I want to do is fade out several objects at once and when they finished a special function gets called. Are there other possibilities when using tweenlite available or do I have to use timelinelite?
how to make the objects in your flash move without tweening? example, I have 2 retangles and I want the 1st rectangle to move left and bounce at the edge of the scene. and the 2nd rectangle move to the same direction but not the same speed.
I'd like to remove objects via removeChild after Tweenlite has finished tweening. But it doesn't really work because my objects are still in the DisplayList.
Code:
//TweenLite.to(sndText, .5, {alpha:0, onComplete:removeChild, onCompleteParams:[sndText]});//does not really work; still in DisplayList TweenLite.to(sndText, .5, {alpha:0}); TweenLite.to(musicText, .5, {alpha:0}); TweenLite.to(sndSlider, .5, {alpha:0});
Is anyone else having trouble with the new tweening in CS4? Every time I enter a numeric value to position a movieclip it changes it! I'm getting very frustrated trying to do the simplist things - even when I move the clip manually it puts it back where it was. Am I missing something here?
im having loads of difficulty with a really simple piece of actionscript.I've actually build something similar to this before, but im totally lost as to how I did it last time.Basically, I have a site im working on, and its a liquid style flash site, where, when the browser is resized, so is the content/layout. As part of the project, when the content expands/contracts I want the main movie clip to remain in the middle. eg. if some new content gets displayed on the left of the clip, move the master clip along so its always centered. hmmm... little hard to explain in english, so i've attached a fla file..I've got pretty much all the code working, but for some reason, it just isn't accurate... its doing something though, which makes my head hurt even more... and just to totally throw a spanner in the works, when you resize the player, the calculations go totally way off
All I need to do is rotate an object (which could spawn at any point along each of the four edges of the screen) so that it faces towards the centre of the screen. Obviously this will be done using the .rotationZ property. I will know the starting point of the object, and the centre point of the screen (400, 300). The object begins facing directly 'up' (e.g. if it spawned directly below the centre of the screen it would already be at the correct angle).
i have a triangle that i generate using the following code:
Code: Select allinternal function generateTriangle(w, h, topPoint, color = "0xFF9900") { var triangle:MovieClip = new MovieClip(); with (triangle.graphics) {
[Code]....
I use this function and a foreach loop to generate 9 differently colored and sized triangles, which works fine when i place them on the canvas. But if i try to rotate them they rotate around the 0,0 point - i want them to rotate around the center of the individual triangles, how do i do that?
1. How do i move a dynamically generated triangle inside a movieclip? Solved using [URL]
2. How do i access each of the triangles inside the movieclip, or even better, place them in 9 different movieclips using addChild so that i can move them around individually?
I'm just a graphic designer and basically new to flash. But i got this project where background images would loop in full browser resolution. Well i managed to work on the looping images, but i'm having trouble on how i will add objects that will tween from side to center in same full browser resolution.[code]...
All though I can scale down the size of my objects and can shift them to their correct positions when scaling. I cannot shift them to the correct relative positions, relative to the screen centre.
Code: level=1; //starting scale level public function scaleOut(level:int) // scale to a level 1-4{ for (var r = 0; r < Main.ballArray.length; ++r){ // scale radius Main.ballArray[r].bRadius *= (oldLevel / level); [Code] .....
I'm getting the following error: Motion tweening will not occur on layers with ungrouped shapes or on layers with more than one group or symbol. I don't have any ungrouped shapes (it's all text), each layer has 5 instances of only one symbol (keyframes), no objects are grouped and text is all static text.
When watching the animation, the first word (web) looks fine, on the second word (design) the tween fails on the last couple of frames of that clip (the blur filter disappears), the third word (and) is OK, and on the forth word (development) the blur filter is not applied to the last 16 frames of that clip.I broke each animation into its own MC thinking that was causing the issue, but that didn't fix anything.
Was wondering if there is a script that can mutiply objects over the time line.So for example if one rock appears in frame 1, and then a 2nd rock in frame 2and a 3rd rock in frame 3, etc,But say starting on frame 4, six rocks would appear, and on frame 5, twelve rocks would appear...so that the rocks would appear exponentially for example.The numbers or accuracy does not matter, its more about displaying a number of rocks much faster along the time line, instead of 1 rock/frame.
Ok. So there are serveral methods to implement Collision detection like R-trees, Quadtrees, BSP trees Recursive Dimensional Clustering (RDC). Or maybe more.My problem is that I have about 6-8 enemies on stage, some of them moving some of them static and also I have the Hero who is shooting with three types of missiles at same time. So I get about 70-100 objects on stage at a time.My question is, which algorithm to use for this type of problem, and which is the common practice? Also which is the most efficient?I was thinking of implementing Quad trees but I read that thy can be slow, or I am wrong?
2. move this object along the x axis from stage edge to stage edge
3. repeat steps 1 & 2 every 5 seconds
So far i have managed to get my object to spawn in a random place and move from side to side, however every 5 seconds it moves the current object to a random coordinate and continues to scroll on x axis instead of creating another object at a random coordinate.
Here is my code:
ActionScript Code: var distance:Number = 5; var timer:Timer = new Timer(5000); timer.start();
I am having a problem with a scripted animation. I am trying to use the tween class to send three objects across the screen at once. For some reason, this tests fine in "test movie" but the swf stops the second two tweens at their initial points and tweens only the first one. As you can see from the code, they all have different var names and object names.
var medTween:Tween = new Tween(logo3D4, "x", None.easeNone, 1200, -1000, 6, true); var bigTween:Tween = new Tween(logo3D3, "x", None.easeNone, -500, 600, 8, true); var smallTween:Tween = new Tween(logo3D2, "x", None.easeNone, 1000, -1300, 5, true);
I have to incorperate flash animations aswel. Im just wondering about a drag and drop function. I have a fair idea how to do a basic drag and drop function.
I want to communicate with an object within a loaded swf. I know I can use this event listener and function to do so right when the swf has completed loading:
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadSections) function loadSections(event:Event):void { event.target.content.mc.y+=2 }
But I want to be able to manipulate a given object from the loaded swf at any time not just when the loading is complete. So basically as long as the swf is loaded, is there a way to manipulate objects and call functions within that swf?
I have a fixed amount of words. Lets say 20 words. I want each of these words to be put into symbols - so i have 20 symbols (box1...box20). Now i want the boxes to fall from the top of the screen and until they reach below the screen. But (and this is where i'm lost) I want to have them fall at different speeds AND I want to control how many boxes falls at a time. Starting out with one box and when this box is out of the screen I want to control the amount of boxes/symbols entering the screen next.
A function telling that next there should be i.e. three boxes entering and falling/floating across the screen (from just above the top of the screen untill they all have reached the bottom). And i want to be able to call a function which starts X boxes - even before the existing boxes in the scenes has dropped). It would be nice to have a function, ie. fallBox(3) , which may be called at any time.
Can we drag two objects at the same time with the "StartDrag" script?I put in the first frame of my movie two "StartDrag"s but it always took in consideration one.