A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: load swf in flash?

  1. #1
    Senior Member
    Join Date
    Mar 2007
    Posts
    283

    load swf in flash?

    anyone knows if there is a way to load another swf in flash??
    i am trying to create a site..

    i was thinking of using getURL and using popup window but there are too much popup blockers nowadays...

    im trying to create a site where i can put my games in it..

    so how can i make a flash site, that loads my flash game in it?

  2. #2
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    The quick and dirty way is to use loadMovie(). You just need an empty movie clip sitting on the stage with and instance name like target_mc or something. Your loaded .swf will replace target_mc's contents. You can then talk to your loaded movie via target_mc.

    example:
    myButton.onRelease = function(){
    target_mc.loadMovie('mySwf.swf');
    }

    For a more advanced method check out the moviecliploader link in my footer

  3. #3
    Senior Member
    Join Date
    Mar 2007
    Posts
    283
    the quick way worked thanks...
    but how can i specify the specific size and the x and y of the mc?

  4. #4
    Senior Member
    Join Date
    Mar 2007
    Posts
    283
    by the way.. there's a problem... im loading a game..

    that uses hitTest on stage's height and width.. now since im loading it from my website (flash) the stage is bigger

  5. #5
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    loaded content comes in at 100% and will take on the transformations of the target clip. So if target_mc is 200%x200%, the contents will be too. You just need to set a _width and _height or _xscale and _yscale to the target after the load.

    The stage is only as big as your flash movie embed dimensions. If you import your flash at 100%, 100% it will fill the available browser space.

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