A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: [RESOLVED] [MX] Grr... another _level issue

  1. #1
    Junior Member
    Join Date
    Nov 2007
    Posts
    15

    resolved [RESOLVED] [MX] Grr... another _level issue

    Well I've hit another scripting snag. For some reason I am unable to target a movieclip within a .swf file I've loaded with the loadMovieNum command. I've been trying to find the issue here for the last two days and I'm absolutely stumped. So here's part of the script. I've put *** where my main issue is.

    PHP Code:
    function battleview(areanameenemynumberenemy1nameenemy2nameenemy3name) {
    function 
    battleload() {
            
    /*this will load the basic battle stuff and then load the enemies depending on enemynumber*/
            
    loadMovieNum(areaname1);
            
    loadMovieNum("battleinterface.swf"9);
            
    loadMovieNum("character.swf"5);
            if (
    enemynumber == 1) {
                
    loadMovieNum(enemy1name+".swf"2);
                
    battlesetup();
            }
            if (
    enemynumber == 2) {
                
    loadMovieNum(enemy1name+".swf"2);
                
    loadMovieNum(enemy2name+".swf"3);
                
    battlesetup();
            }
            if (
    enemynumber == 3) {
                
    loadMovieNum(enemy1name+".swf"2);
                
    loadMovieNum(enemy2name+".swf"3);
                
    loadMovieNum(enemy3name+".swf"4);
                
    battlesetup;
            }
        }
        function 
    battlesetup() {
            if (
    enemynumber == 1) {
    //***here is the issue, for some reason it won't allow me to target _level5.character
                
    _level5.character._x 999;
            }
        }
    battleload();

    This is the basic set up of part of a game I've been working on this summer. It really just loads all the files.
    Last edited by Blueboy250; 08-07-2008 at 12:21 PM.

  2. #2
    :
    Join Date
    Dec 2002
    Posts
    3,518
    The problem appears to be that the swf has not completed loading before you are trying to access it.

  3. #3
    Junior Member
    Join Date
    Nov 2007
    Posts
    15
    Ah, I had not thougth of that at all. Thanks mate, I'll try a getbytesloaded command to check the .swf loading status before moving onto function battlesetup;. That might just work.

  4. #4
    Junior Member
    Join Date
    Nov 2007
    Posts
    15
    Hmm, well this is looking to be more difficult than I assumed. Can anyone help me out with the getbytesloaded check? I was thinking of trying out the MovieClipLoader class I've heard so much about, but I'm starting to think that Flash 8 isn't it?

    Is there a better way I can do this? Because the way I have it now I'm loading all of my clips through .loadMovie commands os there isn't any movieclip to target until it's actually loaded in the first place.

  5. #5
    Junior Member
    Join Date
    Nov 2007
    Posts
    15
    Nevermind, I've resolved the issue with a couple of setIntervals,

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