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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

gotoAndPlay(variable); not working properly with

Status
Not open for further replies.

krigbert

Programmer
Jun 2, 2005
95
NO
Hopefully it's an easy question - Bad karma to ask all of these stupid things without being able to answer anything :p

This is the code for my preloader (all code is on the main timeline):

Code:
preLoadah.onEnterFrame = function() {
    prosoo = _root.getBytesTotal()/100;
    prosentload = _root.getBytesLoaded()/prosoo;
    pros = int(prosentload);
    this._width = pros;

    if (this._width >= 99) {
         gotoAndPlay(goto);
    }
};

the goto variable is set either through php in the url or through this thing above:

Code:
if (_root.goto==false) {
      _global.goto ='home';
}else{_global.goto=_root.goto;}

Now, the preloader does widen out to 100px, and I can get this to trigger other stuff (like a "click here to enter" link), but it doesn't seem to want to go on. In flashplayer 7 and 8, it never goes on - in flashplayer 9 it only goes on if the goto variable has been set in the URL.

In case it helps, I have a similar thing going on elsewhere, it doesn't work either:

Code:
delay=0;
onwards=400;
preLoadah._width=0;

preLoadah.onEnterFrame = function() {
	if(noplay=="play"){
	  delay+=1;
      pros = int(delay);
      if(this._width<=100){ this._width = pros/4;}
      if (pros >= onwards) {
        abne='go';//starts up an MC that sends the main timeline to the frame defined below after playing - this works elsewhere...
	_global.goto=51;
      }
};

illustration and webdesign
 
I found the problem with the first one, I wrote "if (_root.goto==false)", while I should have written "if (_root.goto==undefined)"

The other one is still there, though, and I have no clue as to what the problem is :\

illustration and webdesign
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top