A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: [F8] Dynamically Uploading and Interacting with .SWFs

Hybrid View

  1. #1
    Member
    Join Date
    Apr 2006
    Posts
    30

    [F8] Dynamically Uploading and Interacting with .SWFs

    Ok, so I want to make a website that has a master flash file that dynamically loads the navigational bar, banner, and page-loading-area as separate SWF files.

    Now I know how to use MovieClipLoader to do this, but what I don't know is how to interact with those movies once I've loaded them in. For instance, getting the buttons on the navi-bar to interact with the page-loading-area. (IE: press home button[on the uploaded navi-bar SWF] and have the home.swf load in the loading-area.)

    Any help on this would be great! I only hope I explained it clearly.

    (PS: I'm using Flash CS3; Action Script 2.0, because I'm very unfamiliar with CS3. However, if you think CS3 would make this easier, I'll be happy to give it a try.)

  2. #2
    Ryan Thomson EvolveDesigns's Avatar
    Join Date
    Oct 2001
    Location
    British Columbia
    Posts
    3,338
    Code:
    this.createEmptyMovieClip("navigation", this.getNextHighestDepth());
    navigation.loadMovie("yourNavigation.swf");
    this.createEmptyMovieClip("mainStuff", this.getNextHighestDepth());
    say you have a button in your nav called home, here's the code you would put on it:
    Code:
    on release(){
         mainStuff.loadMovie("home.swf");
    }
    You would then need to position the x/y cords for the two created movieclips so they end up where you want them on the stage. ( you could also create the two movieclips on the stage then just load the content into them, then disregard to two createEmptyMovieClip lines)


    hope that helps and hope i wrote that all correctly
    Last edited by EvolveDesigns; 06-01-2007 at 06:33 PM.
    Evolve Designs Interactive Media
    the natural selection

  3. #3
    Member
    Join Date
    Apr 2006
    Posts
    30
    Well, I tried that, and it loads the navigation swf just fine, but when I press the button my home.swf doesn't load anywhere. I didn't forget to set the x & y.

    This is the set up I used:

    Flash Project: MySite.flp

    MainLoader.fla - 550x400
    code on frame 1:

    Code:
    this.createEmptyMovieClip("naviBar", this.getNextHighestDepth());
    naviBar.loadMovie("NaviBar.swf");
    naviBar._x = 0;
    naviBar._y = 100;
    
    this.createEmptyMovieClip("mainLoader", this.getNextHighestDepth());
    mainLoader._x = 120;
    mainLoader._y = 0;
    NaviBar.fla - 120x200
    Button - 120x50
    Code in button:

    Code:
    on(release) {
    	mainLoader.loadMovie("Home.swf");
    	mainLoader._x = 120;
    	mainLoader._y = 0;
    }
    Home.fla - 100x100
    No Code. Has a single non-symbol, paint graphic on it.

  4. #4
    Member
    Join Date
    Apr 2006
    Posts
    30
    No more help?

  5. #5
    Ryan Thomson EvolveDesigns's Avatar
    Join Date
    Oct 2001
    Location
    British Columbia
    Posts
    3,338
    on(release) {
    _parent.mainLoader.loadMovie("Home.swf");
    _parent.mainLoader._x = 120;
    _parent.mainLoader._y = 0;
    }

    That will work, it's because your nav is in it's own movieclip so _parent is used to go back to the main timeline before calling hte mainLoader clip.

    Sorry, I disappear on the weekends
    Evolve Designs Interactive Media
    the natural selection

  6. #6
    Member
    Join Date
    Apr 2006
    Posts
    30
    No problem, hey thanks for all the help, I really appreciate it!
    Knowledge is knowing a tomato is a fruit.
    Wisdom is knowing not to put it in a fruit salad.

  7. #7
    Ryan Thomson EvolveDesigns's Avatar
    Join Date
    Oct 2001
    Location
    British Columbia
    Posts
    3,338
    glad to help

    sweet Homework Algorithm LOL
    Evolve Designs Interactive Media
    the natural selection

  8. #8
    Member
    Join Date
    Apr 2006
    Posts
    30
    Thanks!

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