A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Overambitous loader

  1. #1
    Senior Mamba austriaman's Avatar
    Join Date
    Aug 2004
    Location
    Somewhere over the rainbow
    Posts
    472

    Overambitous loader

    Hi,
    Given: a loader & a loadee (see attached files). The loader features two buttons and a container-movie into which loadee is to be loaded.
    Button 1 loads loadee into the container-movie of the loader, Button 2 triggers an actions, namely:
    code:
    on (release) {
    if (_root.mc="ACTIVE") {
    gotoAndStop("SHOW");
    } else {
    gotoAndStop(1);
    }
    }

    The framelabel "ACTIVE" is part of loadee. Hence if loadee hasn't been loaded into loader, the script on Button 2 should perform gotoAndStop(1); intead of gotoAndStop("SHOW");.
    It virtuously goes to framelabel "SHOW" anyway. Any ideas why?
    Help appreciated,
    aut.

    - attachments "loader.fla" and "loadee.fla" deleted. -

  2. #2
    Monkey Moderator Lexicon's Avatar
    Join Date
    Jul 2001
    Location
    UK
    Posts
    2,038
    = is for assignment

    == is for comparrison


    if (_root.mc=="ACTIVE") {
    www.lexicon-design.co.uk
    If we aren't supposed to eat animals, then why are they made of meat?
    If Vegetarians like animals so much, why do they eat all their food?

  3. #3
    Senior Mamba austriaman's Avatar
    Join Date
    Aug 2004
    Location
    Somewhere over the rainbow
    Posts
    472
    Hi, thanks for the reply! I replaced the "=" with a "==" as you said. Now it doesn't work at all , not even when loadee has been loaded.
    PLEASE HELP!

  4. #4
    Senior Member
    Join Date
    Feb 2004
    Location
    Worcester Ma
    Posts
    161
    I think your problem lies in your If statement. You seem to be comparing a movieClip instance ("_root.mc") to a string "ACTIVE" Even if that string is a frame label how can they ever be equal?

    Code:
    if (_root.mc="ACTIVE")
    I think that is the problem.

  5. #5
    Senior Mamba austriaman's Avatar
    Join Date
    Aug 2004
    Location
    Somewhere over the rainbow
    Posts
    472
    Okay, so which code could work for me? Here is what I want to do:
    code:

    on (release) {if /*frame of loadee is labelled "ACTIVE", loader gotoAndStop("SHOW");*/}
    else{/*loader.gotoAndStop(1);*/}


  6. #6
    Monkey Moderator Lexicon's Avatar
    Join Date
    Jul 2001
    Location
    UK
    Posts
    2,038
    You can't get the framelabel like that.

    get your loadee to set a variable in the _root when it loads

    e.g.
    Code:
    _root.active = true;
    and then you can set your loader's button code...
    Code:
    on (release) {
    	if (_root.active) {
    		gotoAndStop("SHOW");
    	} else {
    		gotoAndStop(1);
    	}
    }
    www.lexicon-design.co.uk
    If we aren't supposed to eat animals, then why are they made of meat?
    If Vegetarians like animals so much, why do they eat all their food?

  7. #7

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