A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: flash inside flash

Hybrid View

  1. #1
    Junior Member
    Join Date
    Dec 2003
    Location
    London
    Posts
    17

    flash inside flash

    Hi there.

    I have produced a few flash games and now I'd like to organise them all inside one single flash site. The problem is that if I import the games to my main movie they stop working because of the _root.paths. Is there anyway to get around that? Maybe loading each single swf externally and embedding them to my main movie?

  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Load them into _levels instead, from your main swf. This way you save a lot of potential download time for the user as only the games he sects will be loaded.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  3. #3
    Junior Member
    Join Date
    Dec 2003
    Location
    London
    Posts
    17

    it doesn't work

    I have tried that, but it does not solve the problem of the _root path. I can upload the movies to _level5 for example, but the _root will be always the main movie timeline, so the game gets 'confused'... It's a hierarchy problem; I guess I should take that into consideration when programming the games.

    I spoke to another programmer and he said he had the same problem when doing his site, so he had to reprogram all the features he was attaching to it, or open them on another browser window.

    I used to program in flash 5, I thought they had sorted this problem out on Flash MX...

  4. #4
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Levels only exist in the Flash Player and is totally independent of references to the >-root.

    The _root can only refer to a timeline in inside the swf with the action.

    Loading into a _level requires..

    loadMovieNum("gamename.swf",5);

    Maybe you have references to a specific _level in your games.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  5. #5
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    If really loading on levels, rather than container clips (as you may still be doing), then references to _root shouldn't cause any problems, because they refer to the root level of the loaded movie itself, and not (as it is with container clips) to the root level of the main movie. To target the main movie's timeline from movies loaded on other levels, you'd have to use _level0 rather than _root.

    Post your actual line of code you're using to load your movies on other levels!

  6. #6
    Junior Member
    Join Date
    Dec 2003
    Location
    London
    Posts
    17

    still not sorted

    I've been trying to sort this problem out for days. I realized the problem was because the game I was testing was actualy done in flash 4, so I had refferences to / instead of _root. Apparently flash doesn't like those refferences when I use the loadMovieNum. That's ok because I can always rewrite everything on _root structure instead.

    I have a new problem though. The movie boundaries are not obeyed when using loadMovieNum. My objects that were supposed to fly into the game screen are now appearing in the bigger movie. I tried to mask them with no success. Also, loadMovieNum does not let me position the game at the right place. Any suggestions to correct that?

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