Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Preload SWF files with MovieClipLoader class and Nav Buttons

  1. #1
    Join Date
    Oct 2008
    Location
    detroit
    Posts
    17
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Smile Preload SWF files with MovieClipLoader class and Nav Buttons

    Hello all,

    Thank you to Medyman who pointed me to a wonderful tutorial a few weeks ago regarding preloading external SWFs into an empty movieclip (gotoandlearn.com).

    The above worked like a charm. In addition to a left nav bar, we would like to add "forward" and "back" buttons to the individual external SWFs that are being loaded into the empty movieclip which appears in what is the home page.

    Is it possible to have the "forward" and "back" buttons, within these external SWFs, which are displayed in an empty movieclip, link to another external SWF and have that SWF display in the empty movieclip?

    In other words, once the "forward" or "back" button is clicked, the current SWF is replaced by a new SWF within the same empty movieclip on the home page.

    I have not been able to figure out how to target these external SWFs to the empty movieclip on the home page.

    Any suggestions or help is sincerely appreciated.

    Kind regards,
    Sergio

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Sure,
    It's just a matter of how you call the appropriate actions. The process is the same, you just have to make sure you're loading MCs into the same container.

    If you're calling actions from the main timeline of the embedded SWF, using this._parent should point you towards the MC into which the embedded SWF is loaded.

  3. The Following User Says Thank You to Medyman For This Useful Post:

    Sergio11 (11-18-2008)

  4. #3
    Join Date
    Oct 2008
    Location
    detroit
    Posts
    17
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Hi Medyman,

    Thank you again. Your help is appreciated. I will give this a try.

    Have a great day!
    Sergio

  5. #4
    Join Date
    Oct 2008
    Location
    detroit
    Posts
    17
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Hi Again Medyman,

    If you have time, could you share more of what the code might look like please?

    I used the code below on an "actions" layer, within the scene, of the SWF that is currently loaded into the movieclip (holder).

    next_cms_overview.onRelease = function () {
    mcl.loadClip ("about_us.swf", this.parent.holder);

    Please excuse my ignorance. And, if you are too busy to reply, I COMPLETELY understand.

    Thanks again!
    Sergio

  6. #5
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    You're using AS2, right? If so, the parent selector has a underscore in front. So it should be:

    Code:
    mcl.loadClip ("about_us.swf", this._parent.holder);
    If that doesn't work, add this to the same place that you're adding the above:
    Code:
    trace(this._parent);
    Now, test the main SWF (not the embedded one). Does the output from the trace point to the right MC? If not, you might need to add multiple parent selectors (this._parent._parent, for example).

  7. #6
    Join Date
    Oct 2008
    Location
    detroit
    Posts
    17
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Hi Medyman,

    Thank you very much. I am using AS2. Also, I tested all three options you mention above using the main SWF. I received the following error with the first code:
    "undefined"
    I received the following error with the other code:
    "_level10.holder".

    Please do not feel like you need to offer more help. I appreciate the time you have already given.

    I will better look into taking a class :-)

    Kind regards,
    Sergio

  8. #7
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Hmm...

    What did you put to get this: "_level10.holder"..

    That's not an error. That's what you want. I'm getting it was trace(this._parent._parent).

    If so, try this:
    Code:
    mcl.loadClip ("about_us.swf", this._parent._parent);
    Basically you want the this._parent._parent part to equal the holder movieclip. So, keep tracking until you get that value to equal _level10.holder and then put that value there.

  9. #8
    Join Date
    Oct 2008
    Location
    detroit
    Posts
    17
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Hi Medyman,

    Sorry for the late response... was off-site yesterday.

    Thank you for the additional advice. I will give it a try.

    Kind regards,
    Sergio

  10. #9
    Join Date
    Oct 2008
    Location
    detroit
    Posts
    17
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default This Code Worked

    Hi Medyman,

    Thank you for your help last week. I didn't have much luck (I probably did something wrong). However, this code below seems to work well. I am copying below for others to use. Thanks again for your time.

    Kind regards,
    Sergio

    next_cms_overview.onRelease = function () {
    _level0.holder.loadMovie("about_us.swf");
    }

  11. #10
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Hmm...yeah that would work too. Or you could replace _level0 with _root. I should have suggested that first.

    I've been doing OOP stuff in AS3 so root has an entirely different scope and meaning. That's why I didn't immediately think of it. Oh well

    Glad you got it working.

Bookmarks

Posting Permissions

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