Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Actionscript / July 2008



Tip: Looking for answers? Try searching our database.

Simple stop script refuses to work - sometimes..

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Inspectorjimb - 10 Jul 2008 18:21 GMT
So I have a couple of flash banners that I'm making, they are different sizes
of the exact same thing.  I used this script to stop all the animation inside a
movie clip called main_ufo on the main timeline:
_root.main_ufo.stop();
_root.main_ufo.door.gotoAndStop(89);
_root.main_ufo.outterlights.stop();
_root.main_ufo.lights.stop();

This works on one of the sizes, but will not work on another size.  I checked
and double checked the publish settings (both are set to player 6, actionscript
2.0), made sure all the movie clips were named correctly and present at the
time of the script, and I went into every single movie clip to make sure there
were no conflicting scripts inside them. Still nothing.  I even copied the ufo
clip directly from the working banner and pasted it into the non-working banner
and replaced it in the library.  I tried changing all the _root.'s to this.
I've run out of ideas.  It works on my 120x600 banner and doesn't on the
728x90.
If I had hair I would officially be pulling it out.  Open to any
ideas/suggestions at all.
kglad - 10 Jul 2008 18:42 GMT
below your stop code, what's the following show:

for(obj in _root.main_ufo){
trace(_root.main_ufo[obj]);
}
Inspectorjimb - 10 Jul 2008 18:48 GMT
On the one banner where it's working it traces:
_level0.main_ufo.lights
_level0.main_ufo.door
_level0.main_ufo.outterlights

On the other banners it doesn't respond.
kglad - 10 Jul 2008 18:54 GMT
any banner swf where you fail to see trace output has no movieclip named main_ufo and its _root timeline.  you can expect those banner swf's to not respond to your stop() methods.
Inspectorjimb - 10 Jul 2008 19:02 GMT
http://www.jimtudesco.com/screensh.gif

Soo....... Are we talking a bug here then?  Please note this is working in the
other banner.  This screenshot is taken from the exact frame that the actions
are on.
kglad - 10 Jul 2008 19:28 GMT
the chances of this being a user error are overwhelming.

place a trace("HI") below that for-loop with trace statements to ensure your
frame is being played and check that you're not doing something screwy with
main_ufo (like tweening it and messing up its instance name).
Inspectorjimb - 10 Jul 2008 20:08 GMT
Yeah, I agree.  So I traced hi after the loop and it came up in the output
window on the file that isn't registering a main_ufo clip.  So it is getting to
that frame with the script.  I made sure the movieclip didn't have a tween on
it on that frame.  I've tried it with no keyframe for the movieclip on that
frame (the one with the script) and with an added keyframe there (both times
double checking to make sure the instance is named main_ufo) and neither
worked.  I listed the objects in the debug window and it's showing up as
_level0.instance31.
kglad - 10 Jul 2008 20:50 GMT
if main_ufo was your movieclip's instance name it wouldn't be listed as _level0.instance31.

post a link to your fla and specify the frame that contains main_ufo, if it's not obvious.
Inspectorjimb - 10 Jul 2008 21:13 GMT
http://www.jimtudesco.com/fov_ufo_728x90_2_4.fla

It's frame 265 that the script is supposed to stop everything.  There's a
button that goes to 266 on rollover and back to 265 on rollout.  So the
animation can start back up on rollover and then stop again on rollout.
Thanks
kglad - 10 Jul 2008 22:04 GMT
here's your corrected file:  http://www.kglad.com/Files/fov_ufo_728x90_2_4.fla

you were using the same instance name main_ufo on frame 190 at the end of a tween.
Inspectorjimb - 10 Jul 2008 22:22 GMT
ahhh thanks, I didn't realize that it couldn't be using the name at any time during a tween, I thought it was only if it was tweened on the frame in question.
Thanks again!
kglad - 10 Jul 2008 22:53 GMT
it's never a good idea to use the same instance name for distinct instances.  but i don't remember hearing about this being a problem in the past until just recently.

you're welcome.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.