ActionScript 3.0 :: Getting The Real Movie Width From The Stage?
Feb 3, 2009
I need to get some parameters of a movie adding an as3 code to the beginning. As the code will be inserted in many movies, I need it to be 'general' without any reference to the names of the clipsIn particular, I need to retrieve mouse coordinates and the real movie width. For real movie width I mean the width to whom are referred the mouse event stageX and stageY.For example in this movie http:[url]... the width I'm talking about is the white frame. In fact if you use
ActionScript Code:
stage.addEventListenere(MouseEvent.CLICK,func);
function foo(e:MouseEvent):void[code]....
to get coordinates onclick and you click on the top-left corner of the white layer you'll get 0-0 or similar values.I tried to get that relative width using
ActionScript Code:
stage.stageWidth
but this returns me just the object width (so 100% of my page in the previous example) while I need only the white part width.how can I do this without using any name and referring just to the stage of my scene?
View 4 Replies
Similar Posts:
Jan 19, 2005
im just wondering if theres a way to get the real x and y positions of an object in the real movie ( the root screen) that is locted in another movie
i have an object which is within 2 movie clips, first one and then another , and then my object, now i want to know what the real x and y positions of it is, not the locations realtive to the movieclip it is inside.
View 5 Replies
May 3, 2010
when I check the width of my objects I always get 0. Here is an example:
newTag = new LinkButton();
newTag.label = dataManager.tagViewTimelineModel.tags.getItemAt(i).name;
newTag.setStyle("color","#FFA500");[code]....
I guess because width is a property I can set, but it is not automatically computed by Flex. How can I know how big are my objects (as conseguence of the included text ?)
View 3 Replies
Aug 10, 2010
Lets say that I have a MC called "myMovieClip", and in it there is a: Layer 1: 100px X 100px square Layer 2: 200px radius circle And Layer 1 is set as a mask for Layer 2. Is there a simple way to get the dimensions of the visible elements of the mask effect, and not the bounds of all of the elements in "myMovieClip"?
View 2 Replies
Jun 25, 2009
Is it possible to set the stage height and width of your movie externally via Javascript?For example, I created a very simple .flv player that can have its video src changed externally, but now I'd like to also set the height and width of my stage so if I load in a .flv that is smaller or larger I can have it fit to its size.
View 1 Replies
Jul 17, 2003
How can i make a movie clip the same width and height of the stage using actionscript, when the width of the movie isnt known?
View 12 Replies
May 27, 2009
is there a way to make a minimum width and stop resize? I have a menu I am building that is locked to the bottom of the browser and 3 buttons on the left and a movieClip on the right. When you resize the browser window - currently - you can make the button on the right sink under the three on the left.
[Code]..
View 6 Replies
Jul 13, 2011
how to get a movieclip named "topnav" to resize it's width to match that of the stage. I am trying to resize the width of a top nav bar across a resizable RIA. I have started with the following code but with only partial success:
Code:
stage.addEventListener(Event.RESIZE, resizeListener);
function resizeListener (e:Event):void {
var reg2 = stage.stageWidth / 100;
[Code].....
View 1 Replies
Nov 21, 2011
Running into strange behaviour with flex 3.5. Here is a minimal code:build.xml target:
<target name="player">
<mxmlc
file="${APP_ROOT}/player.mxml"
[code].....
View 1 Replies
Aug 22, 2009
trace ("The Width is: " + stage.width + "."); trace ("The Height is: " + stage.height + "."); The Width is: 0. The Height is: 0. Why is it Zero instead of the document's size ?
View 2 Replies
May 10, 2008
When you resize the browser window the thumbnails rows and columns adjust accordingly to fit.I've managed to attach the thumbnails correct when my enableButtons() function is called but i'm unsure how to approach resizing.
Stage.align = "TL";
var numberOfGalleries:Number = 20;
var thumbMarginX:Number = 163;
var thumbMarginY:Number = 109;
[Code].....
View 1 Replies
Jul 29, 2010
I am trying to reference to top level (stage) width and height of the main stage for the placement of something located inside a movieclip on the stage.
My code is:
Code:
my_loader.x = (stage.stageWidth - my_loader.width)/2;
my_loader.y = (stage.stageHeight - my_loader.height)/2;
But this seems to just relate to the width/height of the mc that my_loader is nested in...
I have tried the following and had no luck:
stage.stage.stageWidth
root.stage.stageWidth
parent.stage.stageWidth
MovieClip(root).stage.stageWidth
View 8 Replies
Oct 5, 2011
In as3 What is the difference between calling stage.width and stage.stageWidth I read somewhere that if we have nothing on stage then the value of stage.width is 0,but what happen when I have nothing on stage but loading contents dynamically on stage?I have tried this and when i have loaded content dynamically on stage then i have got
stage.width=value; // where value is dynamic number
View 4 Replies
Sep 14, 2011
In actionscript 3 (as3) What is the difference between calling stage.width and stage.stageWidth. This was something I remember I got confused about in the past (Adobe's api docs are an artform in obfuscation
View 2 Replies
Sep 14, 2009
I was wondering if any of you can spot the error in my code? I got a bunch of objects called 'jelly' that are gonna bounce around my screen but the problem I got is they don't bounce at all! they just run straight off. And yeah I'm very new to actionscript, can anyone see what I'm doing wrong here?
[Code]...
View 4 Replies
Nov 3, 2009
Is it possible to get the stage height/width on something that isn't added to the stage?
View 1 Replies
Mar 8, 2010
I have a Movieclip on stage with nested movieclips inside. All referenced at 0,0. None of the child movieclips load any dynamic content, animate or have Masked Layers. It does have an input textfield in one of the child MCs. The parent MC shows 280 px width, while it returns 313 px with a .width trace. There is no code that alters the .width value of the parent MC at run-time. And the ParentMC on stage is not scaled (it is at 100% width/height)
View 1 Replies
Nov 17, 2009
I'm trying to get my flash movie so that it pauses when the mouse is over the movie and continues when the mouse is not over the movie during certain segments of frames in my movie clip. So basically I need some code that executes this: if the mouse is over the stage between frame 25 and 45 pause the movie until the mouse leaves the stage or the next or back buttons are selected.
View 1 Replies
Oct 11, 2010
I'm trying to change the position of a movieclip I've added to the stage. When I try to access stage.width or stage.height I get 0. I've tried MovieClip(root).stage, DisplayObject(root).stage, root.stage, stage, and simply width and height. All of these are equal to zero.
View 1 Replies
Jan 16, 2011
am i doing something wrong becasue i have set a min stage size and when my window gets to that size it is meant to stop scaling the flash movie, however it doesnt
[Code]...
View 5 Replies
Nov 22, 2009
What is the best way to get the current, "real" frames-per-second of a running Flash movie using Actionscript 2? By "best", I mean it should be accurate over a period of time (i.e. it does some averaging) and with a minimal built-in performance overhead.
View 1 Replies
Dec 1, 2009
Is there a way to make a mc not effect stage width? I have a grid thats bigger then my movie, can I ignore that grid somehow when I call stage.width?
View 1 Replies
Sep 21, 2010
Is there any way to get the real stageWidth of an loaded swf? The problem comes when the loaded swf has some elements outside the scene. In this case content.width becomes bigger then the scene. My code looks like this:
[Code]...
View 1 Replies
Feb 13, 2010
i have a swf (child swf) which is loaded into another swf (parent swf). I want the child swf to know the stage.width of the parent swf. If I trace "_parent.stage.width." I get output undefined. Is there a way to do this?
View 3 Replies
Jul 17, 2004
Stage.width is changing to the correct value only after one frame. On the first frame it's like 500 something and on the second it's around a thousand. I don't really have any idea what's causing this, but in my fla my prototype is supposed to resize the box and if the last two parameters aren't set it centers it in the dead center (thanks css designing as a side).Well... enough talk, anybody know why it changes?[URL]
View 12 Replies
Feb 2, 2008
i have a mask which is over some thumbnails. i have given that mask the value ofStage.widthi.e mask_mc._width = Stage.width /1;however i would like the mask to e slightly padded left and right so the mask doesnt go edge to edge of the screen any ideas on how i can do this AS2
View 2 Replies
May 11, 2008
I used this script: greengrass._xscale = Stage.width; But I can tell based on the gradient i applied to my fill of that greengrass MC that it's almost double it's size in width and I think it's going past the stage's width. Is there a script to make the greengrass the exact width of the stage and to not go beyond it?
View 3 Replies
Jul 17, 2004
Stage.width is changing to the correct value only after one frame. On the first frame it's like 500 something and on the second it's around a thousand. what's causing this, but in my fla my prototype is supposed to resize the box and if the last two parameters aren't set it centers it in the dead center (thanks css designing as a side).
Well... enough talk, anybody know why it changes?
[URL]
View 10 Replies
May 9, 2009
No matter WHAT I have tried.... a sniffer, no sniffer, stand alone on a webpage by itself.This slash file which is in a popup window 600x400 will not display 600x400 in firefox. It always is 20-40 px larger in both directions. I can't take it anymore!! What the hell is the matter with firefox his file is 6 years old for gosh sakes. It works and has worked online for years... so whats the Firefox problem all the sudden I am begging !If I can find a good flash designer who knows php, js, and html well, I am going to have future projects. But this little gem is a good promotional tool.... but the problem is......... FIREFOX wont display it right ! And why does firefox INSIST on putting the location bar in html popup windows! The window is the right size 600x400.... the flash is not... even with dimension definitions
View 1 Replies
Sep 22, 2009
What I'm trying to do build an FLV player which will take the size of the FLV movie and dynamically adjust the stage width/height to match the FLV.
View 2 Replies