Flex 4 Premium reference to the Stage issue! width and height seem to be switched??

So I am doing a very basic resize effect with a panel, but if I want it to fill the screen, I have to switch stage.stageWidth and stage.stageHeight. I have also traced them out and they come out as switched values. Anyone else having this issue?
protected function panel1_addedToStageHandler(event:Event):void
      trace(stage.stageWidth, " " , stage.stageHeight);

Hi,
You maybe running into some sort of layout constraint also it depends on how you are initiating the animation, if you are doing it on startup you need to wait for creationComplete to ensure all your dimensions have been calculated for the browser. You shouldn't need to use stage dimensions either. The following code resizes a panel to fill the browser. (note using top/left/bottom/right is a lot smoother than width and height).
David
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
   xmlns:s="library://ns.adobe.com/flex/spark"
   xmlns:mx="library://ns.adobe.com/flex/mx"
   creationComplete="application1_creationCompleteHandler(event)">
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
protected function application1_creationCompleteHandler(event:FlexEvent):void
pw.valueFrom=pnl.width;
ph.valueFrom=pnl.height;
fillscreen.play();
]]>
</fx:Script>
<fx:Declarations>
<s:Animate id="fillscreen" target="{pnl}" repeatCount="1" duration="1000">
<s:SimpleMotionPath id="pw" property="width" valueTo="{width}"/>
<s:SimpleMotionPath id="ph" property="height" valueTo="{height}"/>
</s:Animate>
</fx:Declarations>
<s:Panel id="pnl" width="250" height="200" horizontalCenter="0" verticalCenter="0">
</s:Panel>
</s:Application>

Similar Messages

  • How to create a map that is larger than the game in width and height?

    hi,
    i wounder how i can create a map(not the design) that is larger than the game in width and height, part of it will appear in the main page and anther part you can move to it after you press the arrow symbol, but the map is just one image so i want put it in line and out line the game page, and the out line part includes buttons and symbols the player can use, but it will be in line and the other part will be out line when you press the left arrow or the down arrow, how i can do that?
    and is that possible to animate it so when the player press the arrow, will give it action to start the animation in one sec, i know how to animate it if that possible but i don't know which code i will use for the mouse click with the arrow symbol, and how to use the same code in the same symbol to start anther animation depending on which part of the map is on?

    I don't know a lot about mask and masked layers and how to work with the normal layers beside i will use some 3D graphics but not in the background, i will explain all this to you to be more clearly.
    first i am using action script 3.0
    close ex,
    you have 2d map"image"  900*300 pixel.
    this image contains some 2d symbols when you click will go to anther normal map (anther normal layer) so they must appear.
    your game 320*320 px, and the place the map will show on 300*300, and there's basics objects will be in most pages including the page that show the map so i don't know a lot about how this will work with mask layers.
    so you can only see the left side of the map image and what it contains, while there's two arrows one to the left and one to the right there's three cases here,
    first when it show the left side(start from x:0 to x:300), the left arrow will not active when you press and the right arrow will start an animation that make the map image move to the mid side in one sec when you press.
    in mid side (start from x:301 to x:600) the same left arrow will active when you press to send you back to the left side while the same right arrow will be active to send you not to the mid side but to the right side,
    when moved to the right side the same left arrow will be active to send you to the mid and the right will not active when you press and depending on that,
    first how to make the large image appear with the three sides in the same place without effecting the other objects "like disappearing them" ?
    and the codes i need in the same left or right arrow symbol to make different actions with the same symbol when clicked depending on which part of the map is on.

  • What are the units of "Width" and "Height" of a Shape?

    What are the units of  "Width" and "Height" properties of a Shape when programming?
    Something odd like points or twips or tweedles or nibbles?
    http://www.ransen.com Cad and Graphics software

    Width and Height are properties of type Single; they represent the dimensions of the shape in points, where 72 points = 1 inch.
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • How to automate the changing of Width and Height of the document

    Hi,
    I just want to know if anyone already automate the changing of width and height of document(eps file).
    Thanks,
    Buddy

    Check out SetDocumentSetup from kAIDocumentSuite.

  • Perspective 3D width and height (stage relative values) in Actionscript

    Hello!
    I have a small square movieclip in Stage, 100x100 width and height.
    I translated it 90º in Y axis. Then, it looks like almost a vertical line.
    I want to know the "Perspective 3D width" and "Perspective 3D height" values (something like 24x120 as the rotated square now looks like almost a vertical line).
    These values are shown in the movieclip properties, in "3D position and view".
    I put an image showing where the values appear. Does anyone know how I access the values via Actionscript?
    Thank you!

    Hello!
    Thanks for the feedback.
    After your answer, I searched for an hour to find the relation between matrix3D, transform, and the width and height properties. But I couldn't find the answer in there (I already had tried to search there before posting here).
    Maybe the answer can be there too, but "por casualidad" now I just found the solution using this piece of code:
    myMc.getBounds(root).height;
    myMc.getBounds(root).width;
    It solved the problem after 3 hours trying to find the solution! \o/
    Thanks for your attention!

  • Get reference to the stage in a AS Class

    Hello,
    I've created an AIR app with the minimeze() and close()
    options. Now these functions are handled in the MainApp.mxml of the
    application. But I want to move them to a class, so I don't have
    any AS in my MXML file.
    My app works like this now:
    MainApp.mxml creates a new instance the Main.as class (which
    extends MainVisual.mxml) by calling <mainVisual:Main /> in
    the MainApp.mxml
    MainVisual.mxml extends Canvas.
    There I handle all visual elements of my app, but I can't get
    a reference to the stage.nativeWindow here. Does anyone knows how
    to do this?
    Thanks!

    Every display object, including the Canvas, has a stage
    property. However, this property will be null until the Canvas
    object is added to the stage. You can use the ADDED_TO_STAGE event
    to detect when that happens.

  • Every time I get to the stage "uploading artwork and remaining songs" I get the following error :  "ITunes as stopped working"

    I have an issue with ITunes match. Every time I get to the stage "uploading artwork and remaining songs" after 5-10 items have been uploaded I get the following error message :
    "ITunes as stopped working. a problem caused the program to stop working correctly."
    _ Windows 7 (up to date)
    _ ITunes => up to date  => 11.0.2.26
    _ I've already re-installed ITunes and all his components => same issue
    _ this error only appear at the stage "uploading artwork and remaining songs"
    errors found in Windows logs :
    1/ Bonjour Service :
    Client application bug: DNSServiceResolve(d8:d1:cb:e8:f5:14@fe80::dad1:cbff:fee8:f514._apple-mobdev._tc p.local.) active for over two minutes. This places considerable burden on the network.
    2/ Application error:
    "Faulting application name: iTunes.exe, version: 11.0.2.26, time stamp: 0x51253247
    Faulting module name: KERNELBASE.dll, version: 6.1.7601.18015, time stamp: 0x50b83b16
    Exception code: 0x80000003
    Fault offset: 0x0003491e
    Faulting process id: 0xf34
    Faulting application start time: 0x01ce2bc093c6d4b0
    Faulting application path: C:\Program Files\iTunes\iTunes.exe
    Faulting module path: C:\Windows\system32\KERNELBASE.dll
    Report Id: 5e7e1edc-97ba-11e2-9678-00123f3961ed

    Hope that the following can help some of you having the same issue :
    When I run the Network Diagnostics in iTunes. And I got the following error : 
    "Secure link to iTunes Store failed".
    So I followed this tread and this is what I tried so far :
    https://discussions.apple.com/thread/3911927?start=0&tstart=0
    ipconfig /flushdns         => same issue
    netsh winsock reset       => same issue
    Followed the kb TS4123  => no other Winsock Providers that Bonjour
    SFC /SCANNOW    => same issue
    ipconfig /release    => same issue  
    ipconfig /renew         => same issue
    netsh winsock reset catalog   => same issue
    After doing all this tests when I run the Network Diagnostics I still get the same error : 
    "Secure link to iTunes Store failed".
    The strange thing is that I tried to start again the ITunes match and it's seems to work so far. 41 items uploaded and no crash so far (before it was  always crashing before I could reach 10 upload).

  • I uploaded the latest X Yosemite and fond that Aperture did not work. Then I started the new Picture but are not able to upload all my pictures (app half of them) have anybody had the same issue? and can potentially advise me on how to fix it?

    I uploaded the latest X Yosemite and fond that Aperture did not work. Then I started the new Picture but are not able to upload all my pictures (app half of them) have anybody had the same issue? and can potentially advise me on how to fix it?

    Thanls Ernie. I found the solution. My problem was previous to 10.10.3. It looks like the installation of final cut and uninstallation of fcp delte a plugins that was needed for Aperture. I recover from time machine my plugins in Library/frameworks/plugin.manager.framework and now Aperture works ! Ouf....

  • [svn] 3580: MXMLG-243 - Path does not draw in the correct location when width and height are set

    Revision: 3580
    Author: [email protected]
    Date: 2008-10-10 16:24:50 -0700 (Fri, 10 Oct 2008)
    Log Message:
    MXMLG-243 - Path does not draw in the correct location when width and height are set
    Fixed MatrixUtil.transformBounds to offset the four bound points by the origin
    Bug: MXMLG-243
    QA: Yes
    Doc: No
    Review: Evtim
    Ticket Links:
    http://bugs.adobe.com/jira/browse/MXMLG-243
    http://bugs.adobe.com/jira/browse/MXMLG-243
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/utils/MatrixUtil.as

    Hi,
    For web application problem, please post your thread in
    ASP.NET forum.
    Best Wishes!
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and
    makes it easier for other visitors to find the resolution later.

  • SWFLoader.content: stage width and height, can i override to return proper results  ?

    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.

  • CS6 problem. When I open the Mask panel, it takes up the entire screen width and the Looks controls disappear, Also, there is a new panel below the Mask panel that seems to have no purpose that I can find. The documentation says "Mask and Look panels - Th

    CS6 problem. When I open the Mask panel, it takes up the entire screen width and the Looks controls disappear, Also, there is a new panel below the Mask panel that seems to have no purpose that I can find. The documentation says "Mask and Look panels - The Mask panel is now placed next to the Look panel. WIth the masking and grading tools placed side-by-side, you can now work faster on the mask workflow." Is there a way to move, hide, or otherwise manipulate the panels for a custom layout? All the examples I can find on the Web show the Looks panel to the left of the Mask panel where the controls are available.

    Ok, here is what I have so far. Appdelete the iWork and reinstalled. Pages and Number work, but not Keynote.
    Now, I downloaded a couple apps that I need, and no matter what I did, the spinning ball came up and the download stopped till it unlocked itself. It is really frustrating because the download was not completed and whatever came through would not mount. Could this issue be the internet connection? Permission fix showed a lot of Airport issues. I will try to run permissions fix again.

  • How to set a minimum width and height for a stage or scene?

    Hello,
    Does anyone how to set a minimum width and height for a stage or scene?
    I tried listening for width/height property value changes and then adjust the width/height if necessary, but that causes unpleasant flickering of the window.
    In JavaFX 2.1 beta SDK for Mac OS, the Stage class has setMinWidth() and setMinHeight() functions which work very well.
    I'm wondering what's the equivalent way to do that when using the FX SDK for Windows.
    Any help is appreciated!
    Thanks.

    I was wondering how to enforce a minimum stage size with JavaFX 2.0.3.The same flickering way you are currently doing it. See: http://javafx-jira.kenai.com/browse/RT-15200 "Need a way to set the minimum size of a window"

  • The crawled property of Image width and height - is there a differnce when the image is png format?

    Hi,
    We are indexing file share with images and get the properties of Image Width, Image Height, Image Size (we show it as refiners in SharePoint after make it managed properties). Somehow when the picture is png format - we see only Size but not height and width.
    Is that any setting that should be done in the file share (when i select an image in the windows explorer window i can see all its properties, and it seems that png files do expose the width and height properties
    keren tsur

    Hi  Keren,
    According to your description, my understanding is that when you tried to  crawl file share with images, the ows_ImageWidth and ows_ImageHeight crawled property for PNG  file could not be generated.
    For your issue, I can reproduce your issue in my SharePoint 2013 environment. For a workaround, you can upload the PNG images into SharePoint images Library and they would work fine.
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • My iphone 4s has switched to the US app store and i have tried to switch back to the UK app store with itunes but it keeps saying i need to spend all of my store credit first is there any way around this

    my iphone 4s has switched to the US app store and i have tried to switch back to the UK app store with itunes but it keeps saying i need to spend all of my store credit first is there any way around this

    Go here:
    https://expresslane.apple.com/Issues.action
    Ask for assistance.

  • How to change the width and height of the visible part of the of the report

    I have define a report with paper size 'Letter', orientation 'landscape' and 30 columns. Dynamically I am changing width of columns and suppressing many columns of the report.
    Mostly using first 16-20 columns and others get suppressed.
    Now problem is that when navigating the report thru crystal viewer, a huge blank spaces getting display on right of the report. When we take jump to some part of report thru navigation tree, the whole report gets shifted to left and only blank part is visible and it is required to scroll left.
    Even printing is not working correctly.
    Is there any way to change the width and height of the visible part of the report in the viewer thru .net classes? Setting the width and height of the report in Load event handler doesn't help.  
    Example: CrystalReportViewer1.Width = 200; - is not helping.
    Is there any other solution?
    Please let me know.
    Thanks
    Mahesh Patel

    Hi Yogesh,
    Your suggestion 'reportDocument.PrintOptions.PaperSize=PaperSize.PaperLedger;' along with 'PaperOrientation' setting as follow works fine. I tried to switch between Landscape and Portrait depending on report width.
    reportDocument.PrintOptions.PaperOrientation = PaperOrientation.Landscape;
    But problem with crystal viewer remain as it is.
    While navigating report thru crystal viewer, when we take jump to some part of report thru navigation tree, the whole report gets shifted to left and it is required to scroll left.
    Thanks for your very good suggestion.
    Mahesh Patel

Maybe you are looking for

  • Session timeout skillbuilders question

    Application security attributes settings Session Timeout  Maximum Session Length in Seconds   60 On session timeout direct to this URL   <url> Maximum Session Idle Time in Seconds   45 On session idle time timeout direct to this URL   <url> Session t

  • How can I select all subject related messages from Inbox and Sent folders

    L&G, is there any way to select messages containing the same subject from the Inbox and the Sent folder by means of an keyboard shortcut. I.e. I would like to select a message in the Inbox folder and request Mail to display all related mails. Thanks

  • Excluding/hiding fields in PDF email attachment

    Hi all, We have created an online interactive form that has several elements, a dropdownbox, a subform and input textfields, that are hidden for the user in "Preview"/"Display"-mode. We are using the following code to hide the elements (using FormCal

  • M4V vs. MP4 ?

    I'm fairly to a little knowledgeable about video and converting and such ... mostly due to my experience putting video on my iPod classic. But lately I've been messing around with a new program that converts DVD directly to video (instead of using a

  • Gl wise Daywise Cash book and bank book report

    Hi all, Please tell me the tables and fields to create new reports - Gl wise daywise Cash book and bank book reports . or tell me any BAPI is there. send me any source u have. Thanks in advance regards, Chandu Edited by: GoldMoon on Aug 28, 2009 4:56