A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: gotoAndPlay problem

  1. #1
    Senior Member [SH]Doc's Avatar
    Join Date
    May 2002
    Location
    Belgium
    Posts
    149

    gotoAndPlay problem

    Hi,

    I'm developing a picture scroller for a friend of mine.
    In the link below you will see what the problem is...

    I want the movie to continue to framelabel "begin", once it loads. but it gets stuck in frame 2 ("begin" is frame 4 I think...).
    I've used this preloader script a million times and it's the first time it gives me any real trouble...
    If anyone has any ideas, I'd highly appreciate it

    http://doccie.gfx-zone.com/Misc/Overview.html

    this is the .fla file
    http://doccie.gfx-zone.com/Misc/Overview.fla

    thanks in advance

    Doccie
    To accomplish great things, we must dream as well as act.
    - Anatole France

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Vermont
    Posts
    269

    your conditional statement is wrong

    the 'if' conditional will never hold a true value because:

    tBytes will never be less than 0 so.. this is incorrect:

    if (lBytes >= tBytes && tBytes < 0)

    and it should be:

    if (lBytes >= tBytes)

    ----------
    throw the trace statement in the with the preloader code you have in Frame 3 of your Actions Layer and you will see what I mean.

    trace (lBytes >= tBytes + " " + tBytes < 0);
    ----------

    Hope this helps

  3. #3
    Senior Member
    Join Date
    Jul 2002
    Posts
    292
    Try this

    totLoad = _root.getBytesLoaded();
    total = _root.getBytesTotal();
    percentLoaded = Math.floor((totLoad / total) * 100);
    loader.bar._xscale = percentLoaded;
    loader.percentLoaded.text = percentLoaded + "% of " + Math.floor(tBytes / 1024) + "Kb loaded.";

    if (totLoad >= total)
    { gotoAndPlay("begin");
    }
    else
    {
    gotoAndPlay("preload");
    }

    I just changed the total loaded name and the total name and took out what looked like some unecessary bits.

  4. #4
    Senior Member [SH]Doc's Avatar
    Join Date
    May 2002
    Location
    Belgium
    Posts
    149
    thank you, that did the trick!
    To accomplish great things, we must dream as well as act.
    - Anatole France

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center