dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: help! load movie

Hybrid View

  1. #1
    Junior Member
    Join Date
    Aug 2004
    Posts
    5

    help! load movie

    im having some trouble im trying to get this movie to load on the center of this other movie, looks fine when i do it in flash i export it and move it to my web sever and it gets off centerand every one seem to get it in differnt spots take a look

    www.3dattic.com/suck.swf

    help help me here is the code i was using
    //Change "yourFile.swf" to the name of your file.
    //Change the 1 to what level you want to load into
    loadMovieNum("viewer.swf",1);

    //this is a timer that calls the load check function at an
    //interval of 100 milliseconds
    loadInterval=setInterval(loadCheck,100);

    //In this function you will need to change the _level1 to what
    //level you are loading into and also change the x y position.
    function loadCheck(){
    //get the bytes loaded/total data
    var BL=_level1.getBytesLoaded();
    var BT=_level1.getBytesTotal();
    //check if the file is loaded
    if(BL>=BT && BL>0){
    //if the .swf is loaded then set the x y cords
    _level1._y = -150;
    _level1._x = -162;
    //and clear the timer
    clearInterval(loadInterval);
    }
    }


    I found that actionscript ont he forms (thank u it was a big help)thank u Julieanne

  2. #2
    ___________________
    Join Date
    May 2004
    Posts
    3,174

    Re: help! load movie

    if it's appearing too high/left you can use this

    Code:
    loadMovieNum("viewer.swf",1);
    onEnterFrame=function() {
    var BL=_level1.getBytesLoaded();
    var BT=_level1.getBytesTotal();
    if(BL>=BT && BL>0){
    _level1._y = _level1._height/2;
    _level1._x = _level1._width/2;
    }
    }
    if its appearing too low/right, use

    Code:
    loadMovieNum("viewer.swf",1);
    onEnterFrame=function() {
    var BL=_level1.getBytesLoaded();
    var BT=_level1.getBytesTotal();
    if(BL>=BT && BL>0){
    _level1._y = _level1._height/2;
    _level1._x = _level1._width/2;
    }
    }
    or if there's a reason you dont want to use enterframe, the only numbers in your original code that matter are marked in red

    Code:
    //Change "yourFile.swf" to the name of your file. 
    //Change the 1 to what level you want to load into
    loadMovieNum("viewer.jpg",1);
    
    //this is a timer that calls the load check function at an 
    //interval of 100 milliseconds
    loadInterval=setInterval(loadCheck,100);
    
    //In this function you will need to change the _level1 to what 
    //level you are loading into and also change the x y position.
    function loadCheck(){
    //get the bytes loaded/total data
    var BL=_level1.getBytesLoaded();
    var BT=_level1.getBytesTotal();
    //check if the file is loaded
    if(BL>=BT && BL>0){
    //if the .swf is loaded then set the x y cords
    _level1._y = -150;
    _level1._x = -162;
    //and clear the timer
    clearInterval(loadInterval);
    }
    }
    change the -150 and -162 to 0 and 0 and see if that works, next try 150 and 162; otherwise you'll probably have to use a different method.

    if you post the fla someone will probably fix it for you.

  3. #3
    Junior Member
    Join Date
    Aug 2004
    Location
    UK
    Posts
    5
    nice cat :P

  4. #4
    Junior Member
    Join Date
    Aug 2004
    Posts
    5

    thank you!

    thank u very much im going to try thos and see what happend if that dosnt work i will post the fla thank u SO much i was pulling my hair out

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