dcsimg
A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: Finding the movie height and width

  1. #1
    Registered User
    Join Date
    Nov 2000
    Posts
    136
    Is there any way to find the height and width of an .swf with actionscript? I want to move an MC to the center of the movie.

  2. #2
    Member
    Join Date
    Dec 2000
    Posts
    85
    set up variables for your width and height


    theWidth = 800;

    theHeight = 600;


    MC._x = theWidth/2;
    MC._y = theHeight/2;

  3. #3
    Registered User
    Join Date
    Nov 2000
    Posts
    136
    Well, yeah, that would work. But I'm putting this in a Smart Clip, and I don't know what movies it will be put in. So I need to retrieve the height and width with actionscript.

  4. #4
    Registered User
    Join Date
    Nov 2000
    Posts
    136
    Booting to top

  5. #5
    Member
    Join Date
    Feb 2002
    Posts
    79
    Would

    MC._x = MC._width/2;
    MC._y = MC._height/2;

    work?

  6. #6
    Registered User
    Join Date
    Nov 2000
    Posts
    136
    I've tried "movieWidth = _root._width", and I get 0.

  7. #7
    Pillow Daddy m_andrews808's Avatar
    Join Date
    May 2001
    Location
    London England
    Posts
    924
    I had this problem a while ago, and I'm afraid there isn't a solution. I think it might be possible with MX though. Not sure

  8. #8
    Member
    Join Date
    Feb 2002
    Posts
    79
    I tried these two things in mx

    text1=_level0._width;
    text2=_root._width;

    and they worked (gave width of actual content, not stage size) alas, I tried it in flash5 and it didn't work.

    I'll be thinking of a workaround possibility.

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