Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0

Reply
 
Thread Tools Rate Thread Display Modes
Old 09-05-2008, 01:54 AM   #11
Mazoonist
Site Contributor
 
Mazoonist's Avatar
 
Join Date: Jun 2006
Posts: 2,371
Send a message via AIM to Mazoonist
Default

If you test the movie and it works (Ctrl-Enter), who cares whether or not it works when you just play it (Enter) in the flash IDE?
__________________
My Tutorials * My Website
Mazoonist is offline   Reply With Quote
Old 09-05-2008, 02:45 AM   #12
maani786
Member
 
Join Date: Apr 2008
Posts: 89
Default

it could not be possible that stop(); doesnot work in as3 you must doing something wrong. it is all in small letter. as is case sensitive.

in the beginning of every frame (that u are using) of your main timeline.
just put

stop(); // all in small letter

and it will work definately.

Regards
maani
maani786 is offline   Reply With Quote
Old 09-25-2008, 04:06 PM   #13
haplodotx
Registered User
 
Join Date: Sep 2008
Posts: 2
Default

I was able to duplicate this issue with a nested MovieClip with just 2 frames. Both frames have a stop();.

If I were to drag the MC manually onto the stage, the stop(); method would work and stop at the first frame. However if I were to add to the stage dynamically with addChild(), it won't.

When tracing in the frames, I found that the first frame has been skipped , none of the trace from the first frame showed up and went straight to the second. I solved it by adding an extra frame before the first stop();, it works and tracing shows that I'm on the first stopped frame.

Now, the question here is, why does this happen?
haplodotx is offline   Reply With Quote
Old 09-25-2008, 04:26 PM   #14
Canazza
Hungry
 
Canazza's Avatar
 
Join Date: Sep 2007
Location: Glasgow
Posts: 595
Default

can you upload the .fla file where this is happening?
__________________
Canazza is offline   Reply With Quote
Old 09-25-2008, 06:14 PM   #15
haplodotx
Registered User
 
Join Date: Sep 2008
Posts: 2
Default

I've made a simple Test.fla to show how the issue can be reproduced.

Basically, there's a button to add the container from the library. Container has a nested movieclip with 2 frames, a stop(); on each. I've placed one of the Container onto the stage and when the button is clicked, it'll add Container (again) and Container2 onto the stage as well. All for comparison purposes only. I duplicated a Container2 with a MovieClipwith 3 frames, but stop(); on the last 2 only to show what I was talking about as a solution(?).

ActionScript Code:
button.buttonMode = true; button.addEventListener(MouseEvent.CLICK, clickListener); function clickListener(e:MouseEvent) {     var container:Container = new Container();     container.x = 150;     container.y = 150;     addChild(container);         var container2:Container2 = new Container2();     container2.x = 150;     container2.y = container.y + container.height + 20;     addChild(container2); }
Attached Files
File Type: zip Test.zip (7.8 KB, 278 views)
haplodotx is offline   Reply With Quote
Old 09-25-2008, 06:59 PM   #16
visuale
Registered User
 
Join Date: Jan 2008
Posts: 42
Default

I had the same problem. Do you have a program called Documentum on your machine? There was a conflict in a class path. I think the teck guys renamed some file in Documentum and Flash works fine now. Hope that helps!
visuale is offline   Reply With Quote
Old 10-07-2008, 08:29 PM   #17
landon6544
Registered User
 
Join Date: Nov 2007
Posts: 32
Default addChild() skipping first frame in nested clip

This is a very odd issue that needs to be addressed. We shouldn't have to add an extra frame into our movieclips just to get the actionscript to execute. No one likes it when you throw the "b" word around, but putting a stop(); command on the first frame on the timeline is a pretty standard solution to making buttons. If it works when you start with the clip on the stage, but not when you add it dynamically, my only assumption is that flash isn't working the way it is supposed to.
landon6544 is offline   Reply With Quote
Old 10-08-2008, 12:29 AM   #18
Mazoonist
Site Contributor
 
Mazoonist's Avatar
 
Join Date: Jun 2006
Posts: 2,371
Send a message via AIM to Mazoonist
Default

Curiously, if you change the code in the Test.fla file, and move the lines that handle the object creation to the outside of the function, it works like it should, and stops on the first frame:
ActionScript Code:
button.buttonMode = true; button.addEventListener(MouseEvent.CLICK, clickListener); //this was formerly being done inside of clickListener: var container:Container = new Container(); var container2:Container2 = new Container2(); function clickListener(e:MouseEvent) {     container.x = 150;     container.y = 150;     this.addChild(container);     container2.x = 150;     container2.y = container.y + container.height + 20;     this.addChild(container2); }
At first I thought it might be a garbage collection issue, and that keeping references to the containers outside the function would be enough, like so:
ActionScript Code:
var container:Container; var container2:Container;
then inside the function:
ActionScript Code:
container = new container(); container2 = new container2();
But that approach didn't work. I still think it just might be a garbage collection issue, though.
__________________
My Tutorials * My Website
Mazoonist is offline   Reply With Quote
Old 10-28-2008, 07:40 PM   #19
MartinSieg
Registered User
 
Join Date: Oct 2008
Posts: 1
Default

Perhaps the best solution is not to put a stop(); action into a frame on the timeline, and instead tell the clip to stop as soon as you instantiate it, as follows.

Just an idea that might help. I haven't tested the below, because I have never encountered the problem you describe.

ActionScript Code:
button.buttonMode = true; button.addEventListener(MouseEvent.CLICK, clickListener); function clickListener(e:MouseEvent) {      var container:Container = new Container();      container.gotoAndStop(1);      container.x = 150;      container.y = 150;      addChild(container);      var container2:Container2 = new Container2();      container.gotoAndStop(1);      container2.x = 150;      container2.y = container.y + container.height + 20;      addChild(container2); }
MartinSieg is offline   Reply With Quote
Old 10-31-2008, 06:25 PM   #20
bham3dman
Registered User
 
Join Date: Oct 2008
Posts: 1
Default stop(); works for me only in new AS3 projects

I too have experienced this problem of stop(); not working in AS3. However, I only experience this problem when working on converted AS1/AS2 projects. If I create a new AS3 project, the stop(); command works properly.

Edit: So I have since learned that my problem actually stemmed from a lack of understanding as to the extent of code changes in AS3. A lot of the syntax has changed significantly and some commands like gotoAndPlay have subtle changes (frame number and scene are now reversed). These changes were producing errors in my existing code which apparently causes actionscript to cease processing any code in the scene (ignoring my stop(); function entirely). Once I addressed the errors, stop() worked as it always had.

Last edited by bham3dman; 11-07-2008 at 06:07 PM. Reason: A better understanding of the problem.
bham3dman is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Extremely easy script but won't work! Why? Jooma ActionScript 2.0 0 02-02-2006 12:15 PM
How to stop and play movieclips cayohueso ActionScript 2.0 8 07-22-2005 02:53 AM
Need help for stop button! jrk_productions ActionScript 2.0 1 12-07-2004 07:14 PM
script stops in a frame that has no stop(); flash_rocks ActionScript 2.0 0 01-09-2004 07:46 PM
Stop a loaded movie doesn't work! AVETAR ActionScript 1.0 (and below) 5 12-06-2002 02:09 AM


All times are GMT. The time now is 03:22 AM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2010 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.