Stage.width undefined
I have an existing Flash 8/AS2 game that uses Stage.width and
Stage.height quite a bit, problem is that when I package as an AIR
app the Stage.width and Stage.height properties are undefined,
although Stage itself still shows up as an Object with 8-10
properties, all of which are undefined.
Under Flash 8/AS2 how can you get Stage.width and
Stage.height to work in AIR?
Any help is appreciated!!
Is this still a know issue? is there a fix?
I have the same problem and as i can see the bug is open
since april 2008.
Regards
Similar Messages
-
Loading flash 8 SWF in adobe AIR, loses the stage width in flash 8 SWF
Currently i am using a CS3 IDE to compile AIR application.I
am trying to load the flash 8 SWF inside my AIR application.After
loading the SWF, when i try to trace the stage width inside the
flash 8 SWF , it says undefined.Not sure why..
Googling few hours not able to get the solution.
Please help me on this, urgently needed.
Thanks in advanceThis is a fairly common question on these forums. Basically,
AS2 and AS3(Flex/AIR) can't communicate directly. You will either
need to use LocalConnection or use ExternalInterface and javascript
to pass info between the 2. -
How can I get stage width of an loaded swf?
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:
var request:URLRequest = new URLRequest(file.url);
var loader:Loader = new Loader();
loader.load(request);
loader.contentLoaderInfo.addEventListener(Event.INIT, checkSize);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, addImg);
private function checkSize(e:Event) {
// this is where I need to see the width of my loaded swf
trace(e.target.content.width);
private function addImg(e:Event) {
trace("complete");
Thanks,
AndreiI don't think you can get the stage width of the loaded file unless you assign it as a constant somewhere within the file. The loaded file forfeits its stage when it is loaded into another swf
-
I built a video player w/ fullscreen mode. I just upgraded my
moniter to a 30" and when I tested the video player my bg_mc did
not scale the total width of the screen. I then checked youtube,
revver, dailymotion, ect. All had the same behavior. I tried adding
1000 pixels to the Stage width and it had no affect.
Why is the max Stage.width smaller then consumer monitor
resolutions?
What is the max width for a single mc?
When is this going to be corrected?This is a peer-to-peer forum, and by no means official
support. Please
Contact Adobe for
official support. -
External SWF using stage width & height...
Hi,
I have an external .swf file (zoomify-esque) that I would like to use in my Flex app, but it's size attributes use the stage width and height.
This basically means that the loaded swf file will load at 100% of the size of the stage. I can resize the loaded .swf using whatever Flex component I put it in, but that shrinks it rather than behaving like it would if I embedded it in an HTML page.
I hope that makes sense. If anyone could help me out with this, I'd be very grateful!
Thanks in advance,
Alex.Thanks for your response Alex,
The swf is from an external company that we pay for virtual slide serving software, and I am currently unaware of any other zooming tools that can efficiently view medical images averaging over 5 gigapixels in size. If you know of any, that'd be really useful, but correctly embedding the original swf is preferred.
Alex. -
Revision: 12007
Revision: 12007
Author: [email protected]
Date: 2009-11-19 12:45:27 -0800 (Thu, 19 Nov 2009)
Log Message:
When the Internet Explorer browser window is obscured Stage.width and Stage.height never return the proper sizes until/unless the IE window is unobscured long enough for the player to feel it needs to render initially. This was preventing our preloader from completing, since we were waiting for a non-0 Stage size. Took a slightly different approach to solving the bug for which the original logic was added to work around.
QE notes: None
Doc notes: None
Bugs: SDK-24191
Reviewer: Alex, Evtim
Tests run: Checkin
Is noteworthy for integration: No
Ticket Links:
http://bugs.adobe.com/jira/browse/non-0
http://bugs.adobe.com/jira/browse/SDK-24191
Modified Paths:
flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManager.as
flex/sdk/trunk/frameworks/projects/framework/src/mx/preloaders/Preloader.asRevision: 12007
Revision: 12007
Author: [email protected]
Date: 2009-11-19 12:45:27 -0800 (Thu, 19 Nov 2009)
Log Message:
When the Internet Explorer browser window is obscured Stage.width and Stage.height never return the proper sizes until/unless the IE window is unobscured long enough for the player to feel it needs to render initially. This was preventing our preloader from completing, since we were waiting for a non-0 Stage size. Took a slightly different approach to solving the bug for which the original logic was added to work around.
QE notes: None
Doc notes: None
Bugs: SDK-24191
Reviewer: Alex, Evtim
Tests run: Checkin
Is noteworthy for integration: No
Ticket Links:
http://bugs.adobe.com/jira/browse/non-0
http://bugs.adobe.com/jira/browse/SDK-24191
Modified Paths:
flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManager.as
flex/sdk/trunk/frameworks/projects/framework/src/mx/preloaders/Preloader.as -
Swf = stage width in Dreamweaver
I created a Flash navigation bar with the bar = stage width
and button elements centered. Works fine in Test Movie mode or
Flash Player, but tried to insert Flash movie into Dreamweaver HTML
page as the header nav bar and the Flash file stays same size and
does not expand in width to fit stage width. Any
suggestions?I tried that and it didn't work. This is the Actionscript
Flash code for the nav bar. Stage.scaleMode = "noScale";
Stage.align = "TL";
bar._width = Stage.width;
dots2._x = Stage.width-200;
menu_bar._x = (Stage.width/2);
symmlog._x = (Stage.width/2);
basebar._x = (Stage.width/2);
stageListener = new Object ();
stageListener.onResize = function(){
Stage.align = "TL";
bar._width = Stage.width;
dots2._x = Stage.width-200;
menu_bar._x = (Stage.width/2);
symmlog._x = (Stage.width/2);
basebar._x = (Stage.width/2);
Stage.addListener( stageListener );
The bar itself stretches to fill stage width at any screen
size, the buttons and logo center in the middle of the bar at any
size. When I add the swf file to Dreamweaver, the size of the nav
bar does not stretch to fill the stage width. The addition of the
above code seemed to make no difference. Is there anything else I
could try? -
Is there a limit to stage width?
Whenever I try to set stage width to anything larger than
1000px, Flash doesn't actually cap the number to 1000 but creates a
file that's significantly less than a target width. I traced the
Stage.width and what's really bizzare is that numbers are not
consistent across projects and even change after restarting!!! Like
I would try to set the width to 1200, 1500 or 2000 px in one
project and the traced value would always be 1023 but 1173 in
another. Then after restarting, 1023 would change to 1025 and 1173
to 1186!!!. Am I going crazy?visitor13 wrote:
> Whenever I try to set stage width to anything larger
than 1000px, Flash doesn't
> actually cap the number to 1000 but creates a file
that's significantly less
> than a target width. I traced the Stage.width and what's
really bizzare is that
> numbers are not consistent across projects and even
change after restarting!!!
> Like I would try to set the width to 1200, 1500 or 2000
px in one project and
> the traced value would always be 1023 but 1173 in
another. Then after
> restarting, 1023 would change to 1025 and 1173 to
1186!!!. Am I going crazy?
2880x2880
Best Regards
Urami
<urami>
If you want to mail me - DO NOT LAUGH AT MY ADDRESS
</urami> -
When creating FL 3.0/3.1 app and testing it at the CS5 Device Central if you change the profile of the active device(select different phone with different screen size) Stage.width/Stage.height could't change. Always stays the same as the first device's Stage.width and height. Even if you add addListener with Delegate nothing happends. Also it effects to Screen Oriantation. It looks like a problem or is this a bug?
Having the same problem, though I can't get it to connect even once. I just started researching the problem tonight - no solution yet...
I'm on Windows 7 Pro 64-bit, Production Premium CS 5.5.
I've got no other internet issues, Adobe update works fine.
Please - Anybody have an idea how to troubleshoot this problem?
Thank you. -
Get the stage.width before including on DisplayList
Hi!
I have a component, that automatically get the stage.width
and stage.height. But the property stage is not valid until I draw
the component with a addChild method. I would like to get the
stage.width and stage.height properties without needing to include
the component on the DisplayList.
So, two questions:
1. Is there a way to get the stage.width and stage.height
without adding it to DisplayList (with a addChild)?
2. What is my component does not extens a DisplayObject, how
do I get the stage.width?
Thank you,
CaioToOn!So, any suggestions?
CaioToOn! -
How to keep the stage aspect ratio when stage width=100%?
Hey,
if I would like to make an animation that always fits into the browser window by fitting the width to 100% I'm having trouble keeping the aspect ratio of the stage's height. I can only configure 100% there which will stretch the content also to 100% of the browser window's height. If I configure a pixel value for the height, then I am also stuck on this value.
All I want is the stage to adjust to the width of the browser window, and the height of the stage to preserve the aspect ratio depending on the width.
this video shows what I mean. unfortunately I am not familiar with coding: http://www.youtube.com/watch?feature=player_embedded&v=hrLt0Y9QAY8
Can somebody help me?sorry can't get the code working properly onwith the html code function. Sorry for that
-
Hiya.
I'm loading with SWFLoader games that where written using stage functions to get the width and height of the stage and to draw the game and calculate game movements accordinly. When I load a game using SWFLoader, the stage size changes from the stage size of the flash application that i loaded with SWFLoader to the stage size of my entire flex application with breaks the loaded flash application.
is there a way to override the stage related functions in the loaded flash application in order for them to return the proper value ?
if my flash application is width=50px height=50px and it's located at my flex stage at x=20px width=20px,
then the width and height of the stage of the flash application will return 70px.
is there a way to resolve that ?If an app has dependencies on stage size, it will not behave well as a
sub-app. -
Abobe Flash CS3 Stage width and height Using script
Hi,
How do control the stagewidh and stageheight USing script in AS3?
Thanks.stage.stageWidth=whatever;
but check the stagescalemode class. -
How to centre the stage of 100% width in a browser?
I have created a web page in Edge that I intend to be centred in the web browser. If I keep the stage to fixed width (960 px) then I can centre it in the browser with the following in the compositionReady event of the Stage:
$("#Stage").css("margin","auto");
However, I want to create a tiled background, for which I use the following in the compositionReady event of the Stage:
$("#Stage").css("background-image","url(images/[email protected])","background-repeat","re peat");
If I keep the stage to fixed width then I don't see the tiled background because the stage is full of objects and the tiled background doesn't extend past 0 and 960px. If I make the stage width 100% then everything becomes left-aligned, but I do see the tiled background (to the right of the stage objects).
I've tried thinking of clever ways to position everything relative to some transparent element that has its width property set to 100%, but to no avail.
Does anyone know of a way to ensure that everything positions relative to the centre of the stage while retaining the 100% width stage property?Zaixist posted this a long time ago and you might want to try it:
$("body").css({
"background-image":"url(images/yourBghere.jpg)",
"background-position":"center center fixed",
"background-repeat":"repeat",
"-webkit-background-size":"cover",
"-moz-background-size":"cover",
"-o-background-size":"cover",
"background-size":"cover"
$("#Stage").css({"margin":"0 auto"})
jQuery.fn.center = function(){
this.css("position","absolute");
this.css("top","50%");
this.css("left","50%");
this.css("margin-top","-"+(this.height()/2)+"px");
this.css("margin-left","-"+(this.width()/2)+"px");
return this;}
sym.$(".center").center(); -
Dynamically changing the height and width of Stage
Hi,
I would like to know how can I change the height and width of stage dynamically. I tried it with the following code:
Stage.height = 250;
Stage.width = 250;
during the run time. Initially the Stage is at a height and width of 370 and 450 respectively. Also when I tried to trace the height and width of Stage after resizing the stage width and height, its showing the old value of width and height. That means the width and height not chnaging. Anybody have any idea about this.Hi Ross,
I could understand something about the problem after making a research on this topic. We can't change the width and height of stage from actionscript itself, right? I will explain the way I am planning to do. I don't know whether its right or not. Anyway you just go through it. First the player need to be resized, according to the specified height and width. Then in the object tag, there are two fields named height and width. We should change these value according to the specified height and width of video controller, dynamically. Am I right? But I am confused with two properties of Stage such as: align and scaleMode. The code was actually developed my trainer. There, the scaleMode is set to "noScale" and no align property is used. My doubt is how should I set align and scaleMode properties of Stage. Hope you understood what I meant.
Regards,
Sreelash.S.
Maybe you are looking for
-
SQL Features for FIM Synchronization Server
Hi, As we need to Install the FIM Synchronization server of FIM 2010 R2 SP-1 only. Could you please suggest if all the below sql server features are mandatory to install for FIM synchronization Server. Database Engine Services Full-Text Search Anal
-
VoIP calling on the N82?
I had a few questions about the internet calling on the N82 1. How does this work? How do you set it up? 2. Is it free? Do you actually get to call long distance, to Europe, China, etc. areas for free? 3. Is there a catch to it? 4. Can I set up anoth
-
Winsockread Error in LabVIEW PDA
Hi all. I am currently trying out the VI server example given in the LabVIEW PDA toolkit but i keep getting this error "WinsockRead error Error Code: 10054. The LabVIEW example project I am using is "VI Server- Pocket PC.lvproj" and I have loaded the
-
How to produce different outbound delivery based on different schedule line
Hi, I want to create different outbound delivery based on different schedule line time,but system automatically create a combining delivery document with a sum number. For example, schedule line date goods issue time qty 2011.08.24
-
Probleme d'exportation sur bande CS5
Bonjour, je n'arrive pas à exporter sur bande une séquence DV dans CS5. Dans Fichier/exportation/bande la caméra est active. Je lance l'exportation. L'écran de mon camescope avance mais reste bleu. A la fin la fenetre PPro indique "exportation réussi