Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vanishing variables

Status
Not open for further replies.

krosshair

Programmer
Feb 28, 2003
34
GB
This is a follow up to a post I had earlier in the week that bill helped me with (so if your still out there!).

The accepting .swf takes the variable with this code...

(frame 2)

if (vars == undefined) {
gotoAndPlay(1);
}else{gotoAndStop(vars);}

stop();

-- The problem is I have a movie loader on the key frame before this. After the loader does it thing it ignores the code above and just rolls to the first frame in the time line (i.e. not passing the var and jumping to the frame it should)

load movie code...

(frame 1)

onClipEvent(enterFrame) {
bytesLoaded = _root.getBytesLoaded();
bytesTotal = _root.getBytesTotal()
percentLoaded = Math.round(100*bytesLoaded/bytesTotal);
_root.displayText = "__"+percentLoaded+"__";
if (bytesLoaded == bytesTotal) {
nextFrame();
}

-- what am I doing wrong? I tried incorporating the code, but my actionscripting skills are pretty minimal.

Thanks!







 
this should fix it.

onClipEvent(enterFrame) {
bytesLoaded = _root.getBytesLoaded();
bytesTotal = _root.getBytesTotal()
percentLoaded = Math.round(100*bytesLoaded/bytesTotal);
_root.displayText = "__"+percentLoaded+"__";
if (bytesLoaded == bytesTotal) {
gotoandStop(vars);
}
 
Thanks Bill - I did try that amongst a few other combo's and it does not work for me - it still rolls to the first frame in the timeline. Not jumping to the label further down the timeline.
 
try this

_root.gotoandstop(vars);

also stick a dynamic textbox on the page with variable name vars and see what goes in there.
 
Thank you - I have found an easier way to do what I need - I continue to have problems with this er.. problem/code.
cheers - thanks for the help
 
glad you got it to work. ill take these files off now. it was simple really. only 2 lines of code to fix.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top