ActionScript 3.0 :: Get External Swf Width Height?
Jul 1, 2009
I'm am trying to load an external swf file using a different swf that is on a different domain. I have noticed that it is possible to use addChild on the external swf, but when I try to get its contents width and height using contentLoaderInfo I get a security sandbox error.it is possible to fix it by usingSecurity.allowDomain("*") andSecurity.allowInsecureDomain("*") in the external file.And now it's get tricky, the external swf file is a file that users upload to my site so I don't have control on the code so I can't add the "allowDomain" part.The second swf (the host file that loads the external file) is a file that I let others to embed on their site.The intresting thing is that when I share the host swf on facebook there is no problem, and I don't even need to add the code for "allowDomain" on the external file.I it makes a different, I use HTTPS protocol to access to the external swf
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'm am trying to load an external swf file using a different swf that is on a different domain. I have noticed that it is possible to use addChild on the external swf, but when I try to get its contents width and height using contentLoaderInfo I get a security sandbox error. It seems it is possible to fix it by using Security.allowDomain("*") and Security.allowInsecureDomain("*") in the external file. And now it's get tricky, the external swf file is a file that users upload to my site so I don't have control on the code so I can't add the "allowDomain" part.
The second swf (the host file that loads the external file) is a file that I let others to embed on their site. The interesting thing is that when I share the host swf on facebook there is no problem, and I don't even need to add the code for "allowDomain" on the external file. I it makes a different, I use HTTPS protocol to access to the external swf. I tried to load the crossdomain.xml file, but no luck. What can I do? the only data I need to get on the external swf is its width and height to scale it to the host file.
I'm loading an external video player SWF into a MC, but once loaded the size of the SWF is always wrong and for some reason takes up the whole stage area.
So i want to set the width and height of the SWF thats loaded. If i set the MC width/height then once the SWF loads it's no longer that size. So i have to have some kinda code, that says once the SWF has been loaded, to resize it to 360x240 pixels. [code]...
I would like to use a movieclip to load a flv video. The problem I have is that I want to change the video dimensions. I've tried several software to change the video dimensions but as far as it seems all of them keep the same height-width ratio than in the original video. Is there any software that would allow me to change the height and width without keeping the same height/width ratio as in the original video file?
I am trying to load an external swf file. The swf width and height is small and I want to enlarge it when loading it. (My scene has large width and height). My current code could load the file but I am not sure how to enlarge the swf width and height.
var request:URLRequest = new URLRequest("index.swf"); var loader:Loader = new Loader() loader.load(request); addChild(loader);
I'm loading external swf and I want to check it's stage width and height, do you know how to do this? I dont want to check the width and height of the swf because it changes depending on which frame is currently playing in this swf...
We sometimes get swfs at my job that doesn't match our standard banner width and height. We only have the swfs and not always able to get hold of the *fla.So we want to load the swf into our different standard banner size and show it.
How do I load the swf into a new *fla that has my standard stage width:995 and stage height: 150? Without distorting the swf to much. Swf could be loading into a MC or loading directly onto stage.I tried the loadMovie and loaded the swf into a empty MC. But I can't set the MCs width and height.
I would like to use a movieclip to load a flv video. The problem I have is that I want to change the video dimensions. I've tried several software to change the video dimensions but as far as it seems all of them keep the same height-width ratio than in the original video. Is there any software that would allow me to change the height and width without keeping the same height/width ratio as in the original video file?
I am looking at the SimpleButton entirely wrong. Here's what I'm doing (inside of a MovieClip):
[Code]...
the close_btn.width and height remain 0. Am I supposed to just rely on the DisplayObject members of the SimpleButton completely and ignore width/height/x/y or what?
I have a flash banner graphic that I created at 1000px wide by 420px tall. I want this to be fluid and fill the browser width, so that when the browser is rescaled the swf fills the horizontal space. My problem is that there is content below it that needs to touch it, but the height is trying to fill 100% so it is creating vertical space between the flash content and the div below it.
I guess a better way to describe it is that I don't want to define the height I just want the width to be 100%. At 100% height there is unused space so I need to make the height maybe undefined or something smaller then 100%?Also, if you make the browser too small vertically the width will not fill. So I want 100% width regardless of the browser height.
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.
I want to write a shell that creates instances of an app and scales it down for animating. Well, I created my shell class and instanced the app and set scales for x and y and then I traced the height and width because I wasn't sure what they'd be. I thought they'd be based on the stuff on the stage or whatever, but they both came up zero. So I'm not sure how that works, am I supposed to have set those values?
I have an empty movieclip in the stage that holds a backgroundbg._width = Stage.width;bg._height = Stage.height;the background is loaded from XML and works fine since I'm not set the width and heightbut if I set: bg._width = Stage.width and bg._height = Stage.height
I have two Canvas A and B, A is the child of B.A can be resized by some user actions like adding some UI components to its base.A is bounded by an other Parent canvas B which should show scolling handles if its child A gets too large.I would like A to have the same width and height of B (or really close) while the calculated width and height of A is smaller than those of B.If w or h of A get larger than those of B then A should grow and B will show scrolling.
I'm a student for design and want to build myself a portfolio, showing pictures and being able to jump between fit_to_screen mode to actual_pixel_size mode. The following code is just the beginning.
I've wrote the code mixing some tutorials (sorry, but I didn't find a good way to clean it so it'll be more focused) - I'm a really new about action script.
myFile is a mc waiting for an external parameter run_url - a string contains something like "/projects/illustration/alice_in_wonderland.jpg"
You can see the trace command marked as red. I'd expect it to give me a number of the movie clip's width, yet i get "undefined"
import mx.utils.Delegate; var streamingID:Number; var fileLoaded:Boolean;
How can I use the width and height that's set by the object's embed code within my Flash movie?
I've got items that position based on stage height/width. Problem is although the object appears re-sized when you adjust the values in the embed, the stage size obviously does not change.
Ideally I'd like to position and scale objects based on the dimensions provided in the embed.
I'm writing jsfl script where I'm setting an element width and height. When I go to run the script, my element's width and height are off by what I set it to. For example, I set the width and height to 800, the results I get for width and height are 799.4, 799.0 respectively. I'm not understanding why my element's width and height aren't exactly what I typed in?Btw, I can go into the "size and position" property UI and set them to 800 x 800 and those values stick. It's only when I set the width and height via the element.width and element.height that my values change on me.
I have a SWF that I would like to use in an XHTML 1.0 Strict document.My need is that the flash must:- Be 100% width- Grow / shrink proportionally in height (depending on width)- The flash may not be cropped or distorted- I must be able to to put a div just before the flash- I must be able to place a div right after the flash. The flash should behave just as if you pasted below image in an HTML file:[code].....
i have a mc which seize is height = 150 and width = 2 (like a line). i have a script which rotate this line and increases its length. this works, however i dont know how to keep the width so that it wil remain 2. this is the scrip in as3 :
function rotateMoveClip_u(e:Event) { var target=(center.x);