Dynamically resize a symbol using AS3 and then apply tween on the resultant symbol - actionscript-3

I am able to use a classic tween to move a symbol on the stage ( frame 2 to frame 15) on stage layer. I apply AS3 command to resize the symbol ( a simple rectangle as movie) in frame 0 on AS3 layer. I issue stop() command at frame 15 on the AS3 layer. They work independently but the resultant resized symbol is not shown. Any help will be appreciated.

Related

Stop scene from symbol actionscript

I'm new to ActionScript.
I have a scene with a timeline, and inside the scene, I have a symbol with its own timeline started animation at frame 10.
I want the scene to stop when the symbol animation hits frame 60.
I can use a scene action script to stop at frame 70. My question is there any way to stop the scene from symbol Actionscript. (use scene object from symbol)
I tried to add this.stop(); in symbol definition but this didn't work.

Accessing animation of nested symbols using AS3 in Flash CS4

It's for my college project again.
I am making a Zombie shoot-em-up game. I created a Zombi symbol with the default Zombie sprite. Inside the symbol I placed three more sprites that are ZombiAttack, ZombiIdle, and ZombiMove, in the frames 1, 15 and 20 respectively. I further converted the sprites to symbols and inside their respective symbols I placed the remaining sprites. So it's like this:
Zombi (Main Symbol):
ZombiAttack (in Frame 1):
inside this I placed the remaining Zombie Attack sprites placed at intervals of 5 frames.
ZombiIdle (in Frame 15):
inside this I placed the remaining Zombie Idle sprites placed at intervals of 5 frames.
ZombiMove (in Frame 20):
inside this I placed the remaining Zombie Move sprites placed at intervals of 5 frames.
In the Zombi Class File I used the following code in the ENTER_FRAME listener's function:
this.gotoAndPlay(20); //For the moving animation of the Zombie.
This plays a static image of the frame 20 and not what's inside it (which I want it to play).
Now, my question is how do I do that? How do I play the nested symbols animation and control it further?
I've found a few posts that address a similar problem but the solution for them isn't working for me as many posts were dated back to 2004 and 2005.
Thanks in advance! :)
Make sure all your symbols are movieclips and give them instance names in the property inspector. (For example, you can name the idle animation "idle_mc").
You could place this actionscript on frame 15:
idle_mc.play();
To make sure that idle_mc plays after the playhead jumps to frame 15. You can also put a play(); command inside the idle animation on frame 1, just to make sure it plays.

Flash Actionscript 3.0 MovieClip Transitions (No Buttons)

I have 3 mc_MovieClips.
Each clip is on a different frame of the same layer in the main scene.
I do not want to use a button to control the play.
On startup, I want Clip1(On Frame1) to play, and when that is finished, Clip2(On Frame2) will play and so on.
I am a very beginner and using Flash Professional CC and actionscript 3.0. The only help I can seem to find calls for global variables, which no longer seem to exist.
I can provide more information if needed, I am just a really big beginner.
Try placing a parent.nextFrame(); on the last frame of each MovieClip and a stop(); on each frame of the parent clip (actual frames of your main scene).

Clip staying on screen while not in timeline anymore

I have a particular problem : I have a fla with 2 frames, with a clip of instance name "my_clip" on frame 1 and no clip en frame 2. If i move by code (like a tween) "my_clip", when I go to frame 2, the clip is still on screen, whereas frame 2 is totally empty in my fla.
How flash work at this level ? Does he stop "syncronizing" a clip with the fla once the clip has been moved by code ? How can I check at frame 2 that the scene should be empty ?
(I'm with flash cs 5.5 and player 11)
Actually what FLASH does when we are trying to change the depth or start drag and some more dynamic functionality it freezes the target movieclip in stage. Eventually there is only one stage in FLASH and guess what if the movieclip has been frozen in the stage? It is visible or available always.
So in your case the same has happened. The clip has just frozen to the stage. Needless to say, the second frame is empty always. You don't need to check the second frame. What all you need to do is remove that clip before you navigates to either next frame or scene.
#LondonDrugs_MediaServices : I can't post my code and fla because there is too much code unrelated to the problem.
But as I was trying to make a little fla to reproduce my problem and show it to you, I figure out that the problem was not where I thought it was : I fact it was because each time I start dragging my clip i was doing a setChildIndex on it to put it on top. And it was precisely the setChildIndex wich would cut the "syncronization" between the clip and the fla timeline.
Thanks anyway for your answers, it kind of help me in a way :)

How to capture current frame from a MovieClip into a BitmapData object?

The movieclip is in a seperate swf file that has been imported into the library. The movieclip itself plays fine (the movieclip is vector based) but when I try and capture the current frame from it into a bitmapdata object nothing seems to happen. I'm wondering if it's some type of security issue?
mc is the movieclip
bitmap=new BitmapData(mc.width,mc.height,false);
trace("Creating bitmap for frame grab width=",mc.width,"height=",mc.height);
bitmap.floodFill(0,0,0xff0000); //for debugging only
bitmap.draw(mc);
After using the code above to capture the current frame of the movie the texture is solid red so it seems that it is not being changed after the floodfill command I put above for debugging.
Figured it out, the image is being drawn but is off the right of the screen since it seems to be using some sort of centerpoint or offset position to draw the movie. If I allocate the bitmap to be 4x taller and 4x wider then I see the bitmap.