A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: linking flash files

  1. #1
    Junior Member
    Join Date
    Jul 2004
    Posts
    9

    linking flash files

    I have a flash file in which there is a button which opens another swf file and plays it. it uses the script
    on (release) {
    gotoAndPlay(22);
    loadMovie ("Ship.swf", "Loader");
    }
    the file Ship.swf is a flash game which uses the arrow keys to move and crtl key to fire.
    when i press the button the game loads proply but only the up and down keys will operate in the game. i cannot move left, right or fire

    is there another way i can link this game to my file or make it so all controls work?
    ☼æ☼§çôTt☼æ☼

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Hmmmmmmmmmmmmh! Curious that only some controls would work and not the others? Have you tried loading the movie on another level rather thanin a container clip?

  3. #3
    Junior Member
    Join Date
    Jul 2004
    Posts
    9
    Does that mean importing the fla file???
    thats the only other way i know

    thats y i posted in this forum as aparently "no question is a stupid question"
    ☼æ☼§çôTt☼æ☼

  4. #4
    The Ancient
    Join Date
    Mar 2000
    Location
    Las Vegas, USA
    Posts
    213
    If the loaded movie is the game, containing all of the controls, the problem is in that imported SWF, not your main movie.

    Check there, instead.
    jahasloth

  5. #5
    Junior Member
    Join Date
    Jul 2004
    Posts
    9
    there is nothing wrong with the game. the swf file runs fine and everything works proply, only wen i load it into my other fla file does it not work

    -- another thing i just realised that none of the hit tests work either
    ☼æ☼§çôTt☼æ☼

  6. #6
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    If the game .swf works fine on it's own, and doesn't when loaded in a container clip in another main movie, it's probably caused by references to _root in the game.swf, that wrongly now point to the _root level of the main movie and no more to the root level of the loaded game movie itself...

    All those references to _root would have to be changed to the appropriate this and/or 1 or more _parent's...

    What surprised me was the fact that some keys still worked while others didn't! All codes on the keys must be similar, and it very curious that it would work on some and not others!

    That's why I suggested trying to load the movie on another level rather than in a container clip, where normally, no script changes would be necessary... And no that's not like importing the movie...

    Try this instead of your script...
    code:

    on (release) {
    gotoAndPlay(22);
    loadMovieNum ("Ship.swf", 5);
    }



    Don't worry about positioning and other related stuff, just check if all code is allways working or not!

  7. #7
    Junior Member
    Join Date
    Jul 2004
    Posts
    9
    yea thx that works well but is there a way i can tell it to load on a certain layer so i can have other things that overlay it

    also wondering wat the 5 in

    loadMovieNum ("Ship.swf", 5);

    is telling my flash to do?
    ☼æ☼§çôTt☼æ☼

  8. #8
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    That's loading your movie on level 5 of the Flash player, and not in a container clip on a layer in your main movie... The higher the level number, the higher the movie will appear over underlying lower levels... Thus your main movie being on level 0, anything in your main movie, will allways appear below what's loaded on higher levels...

  9. #9
    Junior Member
    Join Date
    Jul 2004
    Posts
    9
    and therefore theres no way to load my movie with still parts of my other move showing ontop using that script.

    well i suppose if i load that movie on 1 lvl then load another movie ontop it could probly work...

    they cant just make things ez can they

    well thx for ur help dude
    ☼æ☼§çôTt☼æ☼

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