A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: movieclip loader destroying game

  1. #1
    Senior Member
    Join Date
    Sep 2004
    Location
    West Mids, UK
    Posts
    101

    movieclip loader destroying game

    Hey guys, hope you can help me on this one I need to create a single flash movie that will then load up another flash file (a game)

    Now I have the flash loader working great, I pass the filename to it and it loads up the correct game, however there is one small problem (well not really small big but anyways) you cant use the keyboard to control the game anymore

    I have tried searching for a fix to this but everywhere tells me to put the keyboard functions into the flash loader itself and that isn't an option as the flash loader file will be loading up multiple different games depending on what the users wants to view.

    So my question is this... How can I get my event listeners working again.

    Thanks in advance!
    Code:
    stop();
    
    var myMCL = new MovieClipLoader();//create an instance of MovieClipLoader 
    myMCL.onLoadStart = function (targetMC)
    {
            var loadProgress = myMCL.getProgress(targetMC);
    }
    myMCL.onLoadProgress = function (targetMC, loadedBytes, totalBytes) {
    }
    myMCL.onLoadComplete = function (targetMC)
    {
            var loadProgress = myMCL.getProgress(targetMC);
    }
    myMCL.onLoadInit = function (targetMC)
    {
    }
    myMCL.onLoadError = function (targetMC, errorCode)
    {
    }
    
    myMCL.loadClip("http://www.theurl.com/swf/theswf.swf", "thegame");
    Thats the preloader, as you can see it stays on the single frame so any ideas?
    Last edited by neomaximus2k; 12-29-2007 at 05:17 AM.

  2. #2
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,875
    put

    PHP Code:
    this._lockroot true
    in the beginning of your external swfs
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  3. #3
    Senior Member
    Join Date
    Sep 2004
    Location
    West Mids, UK
    Posts
    101
    Quote Originally Posted by silentweed
    put

    PHP Code:
    this._lockroot true
    in the beginning of your external swfs
    this didnt work still got the same problem

    You can view the file here
    http://www.tikopets.org/temp/tp_loader.html

    also if it helps the game has a MC with the following code to run the keyboard events
    Code:
    on (keyPress "<RIGHT>") {
    Last edited by neomaximus2k; 12-29-2007 at 06:24 AM.

  4. #4
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,875
    If the listeners are working fine in the external swfs, then they should work fine when loaded into the main swf. Usually _root conflicts occur when _lockroot is not used and the external swfs refer to _root.

    You may have to upload the relevant code of the external swfs so we can help further
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  5. #5
    Senior Member
    Join Date
    Sep 2004
    Location
    West Mids, UK
    Posts
    101
    its weird cause all the other comands work fine just the keyboard, then again the game is an old one and could be that the AS is incompatible

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