SWFLoader that unfortunately sets Stage.scaleMode

In a Flex project I have been working on, I've received a new SWF asset to incorporate. No problem usually. However, this asset is setting the stage's scaleMode to showAll. OUCH. This has the effect of this: Flex app loads and looks fine, SWFLoader is later called and the asset is loaded as the SWFLoader's source. The entire stage is scaled up at least 3x the size. On the complete event for the loader I go ahead and set the scaleMode back to noScale, but then the application jumps back to looking correct. The problem is the jumping up then back again.
I am not able to have the asset rebuilt, so I am stuck with what I have. How can I work around this from Flex. Since the stage is shared, this SWF keep dorking everything up.

Depends on what the asset really is.  If you only need a symbol from it, you can try embedding just those symbols and that might skip the code that calls showAll.
If you need the whole SWF because you want the timeline but don't care about what it actually does, you can deploy it on a different domain and then it won't have access to the stage.  It will throw a security error but only folks with debugger players will see it.
Another option is to find out where code that changes scaleMode is.  If it is in a particular class in AS3 in then SWF, you can try creating a custom version of that class in your main app.  You version of the class will supercede the one in the SWF.
Another option is to find out when the code changes scaleMode.  It might be that you can double-check on enterFrame or render events and set it back before the player actually draws it in the wrong scale mode.
Alex Harui
Flex SDK Developer
Adobe Systems Inc.
Blog: http://blogs.adobe.com/aharui

Similar Messages

  • Embed swf change Stage.scaleMode

    Is it possable To change the scale mode of a swf in the html embed code?
    my problem: I have the popular free flash game 'metal slug' as a swf, Its too large and wont resize as it was exported by who ever made it to preserve aspect ratio....
    Ive been trying all day to get it to resize but it wont:
    <div id="Nested" style="position:absolute; left:22px; top:32px; width:400px; height:300px; z-index:1;">
      <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="400" height="300">
        <param name="movie" value="metal_slug.swf">
    <param name="scale" value="exactFit">
        <param name="quality" value="high">
    <param name="flashvars" value="Stage.scaleMode=exactFit">
        <embed src="metal_slug.swf" scale="exactFit" flashvars="Stage.scaleMode=exactFit" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="400" height="300"></embed>
      </object>
    I have tryed lots of different things including trying to tell the swf through flashvars to be 400 by 300, Ive tryed to decompile it and re-export it with sothink but that didnt work as its no longer reconised any of the game sounds, text, and didnt load any more (tryed and tryed)
    I have searched and searched all through google but this swf still refuses every thing i try!
    please can some one show me how to resize this swf?

    Try publishing swf as width 100% and height 100% (File -> Publish Settings -> HTML -> Dimensions: Percent). Then you can bound it with div and set dimensions of div.
    Hope it solves your problem.

  • Stage.scaleMode = StageScaleMode.EXACT_FIT

    Hey all... first time posting here, long time lurker.  I have a problem with a personal project (home automation) that I have yet to figure out a solution.  In essence, I cannot get stageScaleMode EXACT_FIT to work as I would hope.  There is just something about the way the stage is handled in Flex that I'm missing.  I have searched for a solution to this issue for hours and hours around the web, with very little help being provided.  This project has just been in my free time and I have actually gotten so frustrated a number of times at this problem, that it has caused me to give up work on it for a while, however I'm motivated once again to try.
    In a nutshell, I have developed a Flex application with a set width and height.  What I need is for the application to zoom (scale or whatever) to fit whatever container it is in, allowing distortion to occur, and scaling all components, fonts, images, etc accordingly.
    I have tried a number of methods and the only method I have found that works the way I want is to use the Flash debug player, load a wrapper SWF (stub essentially) I created in Flash, which in turns loads the built Flex SWF.  Doing that, I can resize the flash player window or even go full screen and the flex app scales to always fit the container... buttons, fonts, everything scales.  Essentially, the application looks exactly the same at 640x480 and at 1024x768 (albeit smoother fonts, etc).  Understand that this is different that how one would probably develop a Flex app, where the actual UI components expand/contract... I want them to stay the same size, same number of rows, etc... just get bigger... fonts and all.
    Loading just the Flex SWF in the debug player without the wrapper, however, doesn't work.  I can get it to stick to the defined width and height or sometimes get it to scale to an (unknown) stage size, where all that is visible is essentially the top left quarter of the app and resizing the window does cause the app to scale, however only pretty much that 1/4 of the app is visible in the window.  Loading the app directly in a browser (through a page) or even through the stub wrapper SWF provides the same screwy results.  It's almost as if the Flex app has no idea what the size of the actual container it is in, unless it is in the debug player.  Publishing it as an AIR app does the same thing.
    Using the Flash debug player, along with the wrapper, actually gets the job somewhat done for my little project's purposes, however I am really at the point where I need to move this is into either a full on AIR install or be able to run this in the browser (either case scaled correctly), so that I may do other things (launch new windows, possibly interact with the desktop, etc).
    I apologize I'm not a Flex/Flash developer for my day job, so I'm not using the correct terminology (however I am a programmer), but I hope my description of what is occurring will suffice.  I've seen others online with a similar problem and have heard mentions of using some form of scalex/scaley to accomplish a solution, but couldn't find any actual examples of working code.
    Any help would sincerly be appreciated.  I would like to finally get past this, so I can go back to having fun working on the actual parts of the application (and not just getting it to fit the dang screen)... haha.
    Thanks.

    Thanks for that pointer.  I tried playing with finding the (what I would call) "natural" size of the app, as you describe.  When laying out the UI, I always set the viewer to 800x600.  I removed the app's width/height, added some trace statements and here was the output (stageWidth is stage.stageWidth & "width" is stage.width):
    stageWidth = 500
    stageHeight = 375
    width = 548
    height = 596
    If I set the app's width/height to 548x596, this somewhat worked, however it caused proportions on individual components to be off (of course they would scale with these off proportions).
    So that got me thinking.  The app has a viewStack as it's main "base", which was defined having width/height = 100%.  I changed that to an absolute width/height of 800x600.  Without setting an app width/height and running, I then got:
    stageWidth = 500
    stageHeight = 375
    width = 800
    height = 600
    So, naturally then I changed the apps width/height to 800x600 and wholla!  Works/scales (all by itself with no wrapper) in both the debug player and the browser just fine and looks the way I intended.  Neato!  Trace gives me:
    stageWidth = 800
    stageHeight = 600
    width = 800
    height = 600
    Now, getting the same job done in AIR is a different story.  I immediately went to my AIR project and tried, but it still suffers from the same (~1/4 corner of the app) showing up, albeit it tries to scale up with the window resize.  My guess is there is something different with the timing/order of the stage/display elements here, as the code itself (other than it's a windowedApplication") is exactly the same.  Without any app width/height (but setting the viewStack width/height to 800x600), the trace gives me:
    stageWidth = 500
    stageHeight = 375
    width = 800.5
    height = 600
    Now, here is what is strange with the AIR app and what may lead someone that knows this better to tell me how to fix it.  I am setting the stage.scaleMode using the reference from that base viewstack I described earlier.  When I run the AIR App and resize the window smaller, what looks to be the actual app scales down to the point where it actually is smaller than the window it is contained in (albeit still only showing about 1/4 corner of the actual application).  There are borders (padding/blank space) on the right/bottom (I also set stageAlign top left).  Scaling the window larger and larger, just scales that corner that is visible larger and larger (similar to what the browser version was doing), but actually fulls the window with this 1/4 corner of the app.  I know I am missing a "gotcha" about AIR somewhere here.

  • Unfortunately Setting Has Stopped

    When I tried to check my App from setting>App, I received error message "unfortunately setting has stopped"
    Current Android release 17.1.2.a.0.314
    So Any solution for this problem.

    Check if the same occurs in safe mode:
    http://talk.sonymobile.com/t5/FAQ/How-to-boot-your-phone-into-safe-mode/m-p/348008
    All we have to decide is what to do with the time that is given to us - J.R.R. Tolkien

  • My Time Capsule is giving me a warning that  double NAT situation is occurring and recommends that I set it to bridge mode What is all this about please can it be explained in layman's terms and not martian thank you.

    My Time Capsule is giving me a warning that  double NAT situation is occurring and recommends that I set it to bridge mode What is all this about please can it be explained in layman's terms and not martian thank you.

    You have two devices....the Netgear and Time Capsule both configured to act as routers on the network. You only want one device providing this service.
    I suggest that you configure the Time Capsule in Bridge Mode as suggested to eliminate the Double NAT error. Unfortunately, the Guest Network cannot be enabled in this setting.
    No other adjustments are needed and everything else will operate normally...and the Time Capsule will still be providing your wireless network signal.
    Once the Time Capsule is configured in Bridge Mode, it would be an excellent idea to perform a complete power cycle on the network to allow things to reset properly.
    Just power off all devices on the network in any order that you want
    Wait a minute
    Start the Netgear device first, and let it run a minute by itself
    Start the Time Capsule next the same way
    Continue starting devices one at a time the same way until everything is powered backup
    The other option you have is to "ignore" the error and the light will turn green. The Double NAT error may...or may not cause some issues for you down the line. The next time that you update the Mac operating system, or update the firmware in the Time Capsule, it may likely change the Time Capsule to Bridge Mode automatically.
    If your Guest Network "disappears", you will know why this happened, and you will have to manually configure the Time Capsule again in Router Mode to provide DHCP and NAT services.
    Double NAT can also cause a slow down of web page loading. You may...or may not....notice this.

  • How to change a phone number that was set-up when ipad was being set-up. It was my wife's and not mine. want my number as the main number.

    How to change a phone number that was set-up when you first set Ipad up. Took wife's number instead of mine. Her number is on i-cloud and messaging, face time.

    Goto -settings-iCloud-delete account u will then have to set up a new iCloud account.if u do this it will delete anything u may have backed up in  iCloud on your old account.

  • How do i change my sons DOB in his itunes account that I set up as part of the family sharing facility in IOS8?

    I have just set up my children as family members in IOS8 and set the wrong DOB for my son (Phone rang while I was doing it...can't multitask...you know how it is.) And he will be upset when it tells him he is 5 and no doubt poor lad will have complications when he is 18 and Apple think he is still 13!
    How do I change his DOB?
    Thanks
    Using IOS8 on various IPADs

    Hi Dabat,
    Towards the bottom of the Adobe.com page you should see an option to change your geo, make sure that is set correctly before starting the purchase process. Creative Cloud payment works off Credit Card. If your Adobe ID was associated with an incorrect region you would want to contact Adobe customer service for help changing that.
    -Dave

  • I have an iPhone that was set up as a backup of another phone. I want to sync it with my current library; am afraid of losing synced contacts. Will I? Can I prevent this?

    The older phone in question was a work phone that was set up by the owner and then distributed to employees for use. I have a new phone that will be for personal use that I have backed up from the work phone;mainly for the contacts. I want to sync the new phone with my personal library, and I go to do so and get the infamous "erase and sync" message. Will this erase they synced contacts if I do this? (Contacts are what are most important in this case; there is no music stored, for the backup had no music.) If it does, can I prevent this from happening without having to manually replace the contacts?

    You did not restore the new iPhone.
    The first time a new iPhone is connected to iTunes on a computer that is used to sync with another iPhone or iOS device or that was used to backup another iPhone or iOS devide, you are prompted to transfer the backup for the other iPhone or iOS device, or set up the new iPhone as a new iPhone.
    Since the old iPhone was synced with iTunes on a different computer, all iTunes content on the new iPhone (which is none at the present time) will be erased first.
    The warning message should indicate all iTunes content will be erased from the iPhone, which is iTunes content only.
    If you are syncing contacts with a supported address book app on this computer and the supported address book app on this computer includes any contacts, you will be provided a merge prompt for the contacts, which you want to select. Otherwise the contacts on the iPhone will be replaced with the contacts in the address book app on the computer with the first sync.

  • I'm currently signed onto my home network and want to go on with another computer but don't remember my password for my network.  Does anyone know where to find this?  It's a password that I set myself, not the one that came with my router.

    I'm currently signed onto my home network and want to go on with another computer but don't remember my password for my network.  Does anyone know where to find this?  It's a password that I set myself, not the one that came with my router.

    It's in your Keychain on the computer you usually use to connect to your network - the "kind" will be "AirPort Network Password".
    Your Keychain can be opened by using the Keychain Access program. It is in your Utilities Folder.
    Open Keychain Access, and type airport in the search field. You will see a number of entries. Choose the one with the name of your wireless network, open it, and check the box next to "show password". Before it reveals itself you will be asked for your login password - the one you use to log in to your MacBook.
    The network password will appear in the box.
    Quit Keychain Access.

  • HT4314 I have two ipods in my house that were set up under the same email.  I have since assigned two different emails.  How can I change the game center account so that is not shared by both ipods because it is for two different users and they are not ha

    I have two ipods in my house that were set up under the same email.  I have since assigned two different emails.  How can I change the game center account so that is not shared by both ipods because it is for two different users and they are not happy?

    By "game center account", do you mean Apple ID?
    If so, you can change it.
    1. Tap settings and navigate to iTunes and App Stores
    2. Tap "Apple ID" and then tap "Sign Out"
    3. Log in with a different ID.

  • Looking for an app that works with Mac and iPhone that will set calendar reminders of birthdays in contacts.

    Looking for an app that works with Mac and iPhone that will set calendar reminders of birthdays in contacts.

    Hi ron1098,
    Try my application Dates to iCal. it runs on the Mac, but you can sync the calendar to your iOS device.
    See more about Dates to iCal here. It is £4 shareware with a 2 week demo.
    Best wishes
    John M
    As I sell software on my site and ask for donations, the Apple Support Communities Use Agreement requires that I state that I may receive some form of compensation, financial or otherwise, from my recommendation or link.

  • Syncing iCloud with contacts and calendar in MS Outlook 2007, will get message that "the set of folders cannot be opened.  The information store could not be opened."

    I install the iCloud Control Panel and information is uploaded from my Outlook Contact folder to iCloud.  ICloud folders are created and syncing process between my iPhone, iCloud, and Outlook works for a while (day or 2).  Then, when I open Outlook after a day of 2, I get the above message that "The set of folders cannot be opened.  The information store could not be opened."  The only resolve that I have found is to uninstall the iCloud Control Panel, the reboot my Windows computer, then reinstall the iCloud Control Panel and resync contacts and calendar to icloud.  This is getting to be very cumbersome to use this feature.  What is the cause of the problem that it keeps on disconnecting to iCloud?

    I have also fixed it by uninstalling and then reinstalling iCloud, but as you have experienced, the problem recurs without reason.  Apple would/could not help as they say that the problem is with Microsoft's Outlook and that I should talk to them.  Microsoft's techies won't help without me paying some £200 as I have a Professional - a student's - version of Office 2007.  This is scandalous.  It is obvious, from the many who have reported the same problem n this forum, that Microsoft should look into this urgently and create a fix

  • I'm trying to install iCloud on my PC running Windows Vista with Service Pack 2 and I get a message that the set up program is not a valid win32 file.

    I'm trying to install iCloud on my PC running Windows Vista with Service Pack 2 and I get a message that the set up program is not a valid win32 file. Can anyone help me with this?

    What is the exact error message?

  • I have dual boot labs that I set up up for a school.  The Partitions consist of mountain lion and windows 7.  I use bootlicker as the software for selecting the operating systems.  When I choose windows, it takes just under 2 minutes to go to the login sc

    I have a dual boot lab that I set up for a school.  The partitions consist of Mountain Lion OSX and Windows 7 Ent.  I use bootpicker software for choosing the operating system at startup.  When I select the windows partition, it take just under 2 minutes from selection to the windows login screen.  It seems to take incredibly long for the mac to "shut down and hand over the operating system to windows. 
    Do you have any suggestions on how to get this timing faster?
    Thanks for any ideas/input

    The only suggestion I can make is to look ar ReFind (previuosly ReFit). Startup mamangement is one of its features.
    But
    It is very powerful so test it for yourself before deploying it. Some of the functions are best kept out of the hands of the curious, or 'playful'
    And you never answered this question.
    Tell me what the needs are, do the users always need to choose Windows or is this a variable?

  • How do i get all my data and info from my old iphone onto my new one without access to the original itunes that i set my first iphone up on? my partners itunes keeps telling me that its going to replace all my apps and data with his stuff

    how do i get all my data and info from my old iphone onto my new one without access to the original itunes that i set my first iphone up on? my partners itunes keeps telling me that its going to replace all my apps and data with his stuff

    ok so i have my own i tunes library - how do i get all my old apps onto my new library?

Maybe you are looking for

  • Documents not posted to cost center

    Hi, The documents are posted into sap from third party system through interface. And in the transaction OKB9 (default account assignment), cost center is assigned to the particular GL account. The FI document displays that particular GL account conta

  • Firefox is correcting my (swedish) spelling when I type e-mails, but seems to be correcting it in english, which makes every swedish word marked red?

    Firefox is correcting my spelling when I write (for example) e-mails, but it corrects in English, and I write in Swedish. So every word is marked red. This problem does not occur when I use Safari. Have changed to only Swedish in Firefox/Preferences/

  • Customization of Tabs in Central Office

    Hi, I am a first time poster on the forum. I have a question about modifying tabs in Central Office. If I want to add a tab or remove a tab in Central Office is there documentation available that can assist me with that process or some helpful knowle

  • Appear effect problem

    Forgive me if the solution to this problem has been posted - My search didn't work. I have applied the appear behavior to the body of my page and it is not working properly. When it loads it seems to flash everything first and then the appear effect

  • How to open LOV by default

    Hi, I have a LOV at Deptno Column. I wrote that logic If i am going to that column, The LOV will be displayed automatically how it is possible???? Thanks & Regards, Hari Babu