dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Align loaded movieclip

  1. #1
    Senior Member
    Join Date
    Jul 2001
    Posts
    289

    Align loaded movieclip

    I was wondering if someone could help me out. I have a movieclip that is loaded into a blank MC. I want to align the loaded movieclip (that is loaded into the blank MC) to center on the stage whenever the stage is resized.

    How can I do this?


    Thanks!
    Jordan
    Jordan

  2. #2
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    That will do the trick just change the 100 to the location where you want it to appear.

    blankMc._x = 100;
    blankMc._y=100;
    ~calmchess~

  3. #3
    Senior Member
    Join Date
    Jul 2001
    Posts
    289
    but that wont center it when the stage resizes will it?
    Jordan

  4. #4
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    in frame one of your actions layer:

    Code:
    Stage.align = "LT"; //force the flash movie to justify to the top left
    Stage.scaleMode = "noScale"; //prevent the movie from scaling its contents
    
    resizeListener = new Object();//create a generic object
    resizeListener.onResize = function(){  //give it a function for onResize events
    blankMc._x = (Stage.width/2) - (blankMc._width/2); //assumes your registration point in the MC is top left
    blankMc._y = (Stage.height/2) - (blankMc._height/2);//assumes your registration point in the MC is top left
    }
    Stage.addListener("resizeListener");
    //any time you want to force an onResize call you can just say
    resizeListener.onResize();
    Last edited by jAQUAN; 02-24-2007 at 04:07 PM.

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