A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: switching a background without reseting anything on the stage

  1. #1
    Video Game Addict
    Join Date
    Apr 2004
    Location
    Oregon
    Posts
    128

    switching a background without reseting anything on the stage

    I'm making a drag and drop game and I want to be able to switch backgrounds without resetting the position of anything that has been dragged around, how would i do this?

    Note: This is in Flash 5 and it will be used on a button of course

  2. #2
    Banned NTD's Avatar
    Join Date
    Feb 2004
    Posts
    3,438
    Hi,

    Create a movieclip on the lowest layer of your movie and load other swf files in as the background........

    on (release) {
    _root.holderMC.loadMovie("someFile.swf");
    }

  3. #3
    Video Game Addict
    Join Date
    Apr 2004
    Location
    Oregon
    Posts
    128
    wait a minute...its only one movie, so theres only 1 .swf file. But the backgrounds will be graphics.

    What if I made the backgrounds movie clips and used there instance names would that work?

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    NTD's solution is way better. That way, you can have a huge number of backgrounds without your movie becoming huge itself.
    Put each background graphic into a new .fla, publish and load into the lower layer container of your main swf, as NTD suggested.

    gparis

  5. #5
    Video Game Addict
    Join Date
    Apr 2004
    Location
    Oregon
    Posts
    128
    so i import all of the individual .swf files into the same bottom layer of the movie? Or do I make a new layer under each one?

  6. #6
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    You load each swf in the same container (_root.holderMC) , they will replace each other.

    _root.holderMC.loadMovie("bkg1.swf");

    will load the first background .swf into_root.holderMC, which is your container movieClip residing on your lowest layer.


    _root.holderMC.loadMovie("bkg2.swf");
    will load another background .swf into_root.holderMC.

    etc.. as many as you want.

    gparis

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