dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: movie wont load on center of page

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

    movie wont load on center of page

    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/test.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
    Senior Member
    Join Date
    Jun 2003
    Location
    Florida
    Posts
    289
    Whew!! this was tough!!

    Put this code on frame 1 of your movie and change the names to your names

    code:


    stop();
    myInterval = setInterval(movieLoader, 10);
    function movieLoader(){
    if (_root.pressed == "yes") {
    pressed = "";
    createEmptyMovieClip("container_mc", _root.getNextHighestDepth());
    container_mc.loadMovie("tester.swf");
    clearInterval(myInterval);
    }
    }
    _root.onEnterFrame = function(){
    if (container_mc) {
    Xcenter = Stage.width/2;
    Ycenter = Stage.height/2;
    containerXCenter = container_mc._width/2;
    containerYCenter = container_mc._height/2;
    container_mc._x = (Xcenter - containerXCenter);
    container_mc._y = (Ycenter - containerYCenter);
    }
    }




    You will also need to create a button with this code:

    code:


    on (release) {
    _root.pressed = "yes";
    }





    This will work no matter what size clip you import.

    Hope this helps!!
    If it was easy, everyone would do it.

  3. #3
    Flashkit Veteran joejoe2288's Avatar
    Join Date
    Apr 2004
    Location
    Hickville, Oregon
    Posts
    2,554
    i think it might be only for exe's but it might work any way look up fscommand()
    nvm i was just readint he first post, doesn't apply lol
    Last edited by joejoe2288; 08-18-2004 at 02:05 PM.
    So tired of all the fighting....

    http://joejoe2288.kawanda.net

  4. #4
    Senior Member
    Join Date
    Jun 2003
    Location
    Florida
    Posts
    289
    no offense, joejoe2288, but are you inthe right forum?!
    If it was easy, everyone would do it.

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

    thank you

    thank u very much im going to try thos and see what happends thank u SO much i was pulling my hair out. heheh thanks

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