Clip staying on screen while not in timeline anymore - actionscript-3

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 :)

Related

ActionScript 3: Jump to a specific frame and target a MovieClip in that frame

I'm trying to do some stuff in Flash. Let's say I have a MovieClip called mcShape with three frames. In each frame there is a different shape that masks another movie clip, in another layer, that spans for the said three frames. That movie clip is called mcColor and defines the color seen through the shape, thus rendering the desired shape in the desired color:
From the main timeline, on the frame where I have mcShape, I've written the following code:
mcShape.gotoAndStop(some frame);
mcShape.mcColor.gotoAndStop(some other frame);
The thing is this doesn't work. When I don't change mcShape frame, everything works fine, but when I gotoAndStop some other mcShape frame, mcColor is not detected anymore and I get Error #1009: Cannot access a property or method of a null object reference. Even if I put three different frames with a different instance of mcColor on that frame, it doens't work.
Are there any workarounds to this? What am I doing wrong? Thank you very much!
Updating to Adobe Animate seemed to solve the problem.

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).

RemoveChild frame animated MovieClip, will stop frame running?

If I removeChild frame animated Movieclip, will it automatically stop running the frames inside it? Actually without calling mc.stop();
I believe it will continue to play, reason being your movie clip is still a flash entity not on stage( so not for you), but for flash (yes he can see all).
So once you create a new movieclip, play it... you can add or remove the running clip without stopping. Basically changing parent doesn't change the state of the mc.
No. The timeline will still play, and all the framescripts you might have in there will still be called.
Beware of the timeline devils :)

AS3 preloader sorrows, unable to load symbols from library

I created an AS3 preloader, and placed the code for that on frame one.
I then made a symbol, and placed it in the library. It was set to NOT export on frame 1, and the fla's settings had all classes exported on frame two. There were no references to the object until frame two.
Then, flash crashed whenever I compiled without the "Export in frame one" box checked.
To fix this, a friend suggested I start my game logic on frame 3, so it will have properly loaded frame 2. That seemed to work fine, the class was instantiating properly.
Then, it turned out that it was not loading the movieclip, only instantiating the class. Again, this could be fixed by exporting in frame 1, but I really cannot afford to do that.
The same friend suggested I place an instance of the symbol on the stage on frame 3, and perform game logic on frame 4. They said this would initialize the movieclip properly.
However, this was not the case. How can I load the entire symbol, graphics and all, without exporting to frame 1? This single symbol will contain probably 10-20 MB of graphics, so it needs to be preloaded.
Thanks for the help!
EDIT: To make a long story short, all I need is some way to load a movieclip so it can be used and visible and everything.
EDIT: Is there any way to force-load a movieclip via AS3?
Hard to figure out from descriptions.
If you make a new .fla file, paste your large(10-20MB) clip on frame 2,
set your export frame as 2, then try to preload from frame 1 and access the large clip's content in frame 2, do you get the same error ?
say you have this in frame 1:
stop();
this.loaderInfo.addEventListener(Event.COMPLETE, onComplete);
function onComplete(event:Event):void{
gotoAndStop(2);
}
and in frame 2:
trace(myLargeClip);//where myLargeClip would be your 10-20MB clip
It should be ok, otherwise, in case tracing your large clip returns null, you might want to try to invalidate the stage:
on frame 2:
stage.addEventListener(Event.RENDER,onRender);
stage.invalidate();
function onRender(event:Event):void{
trace(myLargeClip);
}
Basically what I'm suggesting is:
Isolate the problem. See if your large clip is causing problems in a similar, but simplified scenario and why, then once you got a fix use it in your main fla.
Try the stage invalidation, although, since I don't fully understand your setup, it's just a wild guess.
HTH,
George

AS3 Play contents of a symbol

I've grouped a multiple layer 1 frame actionscript driven animation into a symbol. (simply put, imagine a 1 frame image being tweened by code over a few sec, in this symbol)
Now I'd like to play the contents of this symbol using an event listener.
But
stuff_mc.gotoAndPlay(1); and Test Movie doesn't play a thing (doesn't even show the contents of the symbol (the picture) which can actually be seen on stage).
If I go inside the stuff_mc and Test Scene, it works perfectly..
So how do I play stuff_mc from the stage?
Thanks in advance
It sounds to me like you are using multiple scenes. If that's the case then this is most likely where your problem is. Scenes are generally a bad idea in Flash – Adobe itself admits this.