controlling loaded movies not in levels
A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: controlling loaded movies not in levels

  1. #1
    RIDER
    Join Date
    Aug 2000
    Location
    Munich-Sydney
    Posts
    177

    controlling loaded movies not in levels

    hi,

    I have searching over and over if it is possible to load a movie into a clip "content" then control that clip.

    I don't want to use levels, no matter what I do it doesn't work.
    Can someone give me some help here...
    __
    on (release) {
    loadMovie("ueber_uns.swf", _root.content);
    tellTarget ("_root.content") {
    gotoAndPlay("about2");
    }
    }


    thanks in advance
    take it or leave it


  2. #2
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,490
    >>I don't want to use levels, no matter what I do it doesn't work.

    Good for you. I never liked them much either. They have their uses, but like most things, they are usually used for the wrong purpose.

    First off, this won't work:

    on (release) {
    loadMovie("ueber_uns.swf", _root.content);
    tellTarget ("_root.content") {
    gotoAndPlay("about2");
    }
    }

    Even if you had written it right, it will load the movie, but not go to the frame label. It will work when testing, but not when on the server, because by the time the movie has loaded, the release event is past. So try it this way:

    on (release) {
    _root.content.loadMovie("ueber_uns.swf");
    }

    The way to get it to go to the label is to use a variable in the on release event handler and have it read by the loaded movie, in frame one of that, like this:


    on (release) {
    loadWhich = "about";
    _root.content.loadMovie("ueber_uns.swf");
    }

    Then in the ueber_uns.swf on frame 1, have this in an actions frame:

    if(_root.loadWhich == "about"){
    this.gotoAndPlay("about2");
    }

  3. #3
    RIDER
    Join Date
    Aug 2000
    Location
    Munich-Sydney
    Posts
    177
    thanks for your quick reply,
    i did try what you suggested by i still only get the first frames "about1" and not "about2"

    I put in the main movie button:
    on (release) {
    _root.content.loadMovie("ueber_uns.swf");
    }
    on (release) {
    loadWhich = "about2";
    _root.content.loadMovie("ueber_uns.swf");
    }
    ------------------
    on the ueber_uns.swf I added in the first frame:
    if (_root.loadWhich == "about2") {
    this.gotoAndPlay("about2");
    }

    still not good....dammn I hate it when I can't see my mistakes
    take it or leave it


  4. #4
    RIDER
    Join Date
    Aug 2000
    Location
    Munich-Sydney
    Posts
    177
    what am I doing wrong here, I have gone over many tutorias trying to understand this, I'm going crazy, please guide me in some way.

    thanks
    take it or leave it


  5. #5
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,490
    No-no. Don't use both onreleases:

    on (release) {
    _root.content.loadMovie("ueber_uns.swf");
    }
    on (release) {
    loadWhich = "about2";
    _root.content.loadMovie("ueber_uns.swf");
    }

    Just use the one.

    on (release) {
    loadWhich = "about";
    _root.content.loadMovie("ueber_uns.swf");
    }

    When ueber_uns.swf loads, the first thing flash will read is this:

    if (_root.loadWhich == "about") {
    this.gotoAndPlay("about2");
    }

    And don't use about2 twice. They are different things, the one in the button is a variable your setting with onRelease of the button. In the loaded movie, it reads the variable, 'about', which will be true, then the next line which sends it to the frame label named about2. Maybe change the variable to something else, so it doesn't get confusing. I usually just use spelled out numbers, like "one", "two", etc.

  6. #6
    RIDER
    Join Date
    Aug 2000
    Location
    Munich-Sydney
    Posts
    177
    thank you for your patience iaskwhy,

    I did again exactly as you said but it is not working

    On the main movie (button) I put
    on (release) {
    loadWhich = "two";
    _root.content.loadMovie("ueber_uns.swf");
    }
    then on the external movie loaded (ueber_uns.swf)
    I put
    if (_root.loadWhich == "two") {
    this.gotoAndPlay("about2");
    }
    Is this what you meant by using "one" "two" and so on?
    take it or leave it


  7. #7
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,490
    Yes, but make sure that part in the loaded movie is on frame 1 of an actions layer frame and at the top of anything else there. Look at this example.
    Attached Files Attached Files

  8. #8
    RIDER
    Join Date
    Aug 2000
    Location
    Munich-Sydney
    Posts
    177
    A million THANKS, I finally got it.
    the file you gave me was a great guide, I noticed that you didn't put the actions on the actual buttons.hmmmm

    I owe you one, let me know if you want to see the end product.

    It is 4:10 am Sunday Morning (Munich), sad isn't it that I've been working all saturday through to the early morning, but I got it thanks to you.

    take it or leave it


  9. #9
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,490
    It still works on the buttons. I just used that main file as a template from something else I had. I hate to type and just changed a few lines.

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

Poll by Flashkit.com