-
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.
-
set up variables for your width and height
theWidth = 800;
theHeight = 600;
MC._x = theWidth/2;
MC._y = theHeight/2;
-
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.
-
-
Would
MC._x = MC._width/2;
MC._y = MC._height/2;
work?
-
I've tried "movieWidth = _root._width", and I get 0.
-
Pillow Daddy
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
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|