ActionScript 3.0 :: Setup The Dimensions Of The File As In Terms Of Height And Width Of The File Without Getting It Cropped
Aug 20, 2009
The template is built under Flash and has .swf, .fla and html files and was setup on an html background. To make things look nice I decided to use an XML web template as a background to his template. The problem starts from there.The XML web template allows us to add our own SWF files, so I decided to add the swf file of my friend's template.
The swf file was set to "noscale" and when I imported it into the web template it didn't fit properly. So I took the "noscale" off from the actionscript and imported it again. Even then the scaling of the swf file was not correct.As soon as you load the file, it scales towards the left and not center.My question is how can I write a code within the fla file so that when the swf file is loaded it automatically centers itself?2nd question is how can I setup the dimensions of the file as in terms of height and width of the file without getting it cropped. I tried to set it up from 840x610 to 650x430 however the swf content got chopped off (even with noscale off).
View 2 Replies
Similar Posts:
Mar 25, 2011
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?
View 3 Replies
Jan 20, 2012
I'm new to flex and I have a question concerning bitmapData and its width and height. Normally you set up bitmapData like this in AS3:
Code:
var bd:BitmapData = new BitmapData(100, 100, true, 0x00000000);
var bm:Bitmap = new Bitmap(bd);
But in Flex embedding an an image works like this:
[Code]...
View 2 Replies
Aug 17, 2004
have a square on the stage that should change in dimensions depending on which button is pressed. This is the code for the buttons:
[Code]....
Is it possible and if yes how to place the different dimensions in an aray and then call them in the on release?
View 14 Replies
Aug 17, 2004
have a square on the stage that should change in dimensions depending on which button is pressed. This is the code for the buttons:[CODE]function setButton() {
for (var i in menuMc) {
if (menuMc[i]._name.substr(0, 4) == "btn_") {
clip = menuMc[i];
[code]......
View 14 Replies
Oct 28, 2009
anyway, so i'm having an issue when getting the dimensions of an image that is masked. I want to get only the dimensions of the visible image, but AS3 seems to only return the height/width of the whole image, even the areas that are not visible (because of the mask).
I could create a custom class that extends the DisplayObject and overwrites the height and width getter to return the dimensions of the mask, but my problem is that I'm placing these masked images into a container DisplayObject, and scaling that container to fit the browser window.
View 6 Replies
Jan 20, 2012
I'm new to flex and I have a question concerning bitmapData and its width and height. Normally you set up bitmapData like this in AS3:
Code:
var bd:BitmapData = new BitmapData(100, 100, true, 0x00000000);
var bm:Bitmap = new Bitmap(bd);
But in Flex embedding an an image works like this:
Code:
[Embed(source="../../../../../assets/sprites/asteroids/asteroid_32_full.gif")]
public static const Asteroid1:Class;
var imageBM:Bitmap = new Library.Asteroid1();
When using the bitmapData (e.g. imageBM.bitmapData) I don't have to set up width and height any more. Does the Flash player know the width and height of a bitmapData automatically even when NOT setting up the bitmapData's width and height? I'm totally unaware about this topic because I don't know whether the Flash player always knows the dimensions of a bitmapData. Could this cause problems when not setting up the dimensions of a bitmapData?
View 2 Replies
Jul 8, 2010
I am trying to increase a swf file height and width so it can fit better in my screen. I don't want to rework on everything again in my fla file because it's big hassle. (changing background size makes every symbol off). Are there anyway to do it?
View 3 Replies
Apr 18, 2011
In the following code Only the button image has been embeded into the flex code. But in the html object or embed tag why the height and width has to be specified. Even though for this is a normal button if we do not specify the height and width there seems to be some error
HTML
<div align="center"><br />
<div style="display:block;width:100px;height:100px;" id="audio"
class="testsound" align="center"/>
<p class="clickable">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="400" height="100" id="myMovieName">
[Code] .....
View 3 Replies
Aug 18, 2010
I have a small issue in ActionScript 2.0. I want to know the stage width and height for external SWF file. I used the following code:
var loader:MovieClip = _root.createEmptyMovieClip('loader', 1);
var obj:Object = new Object();
var mcl:MovieClipLoader = new MovieClipLoader();
[code].......
View 3 Replies
Nov 1, 2009
URL...I'm onto the next step on the AS code (see attached zip file on this thread if you need it - file Untitled-3.fla), trying to get the AS to fill an 800*600px window with the dots when the FLA is run.I have tried a range of things, like this (i.e. adding in the hard coded 800 and 600 into the code:[code]But it doesn't do any good!I can't see any other parts in the AS code where the width and height are defined.
View 1 Replies
Dec 19, 2009
I am loading an external swf file using the following code:
//add close button
var reqButton:URLRequest = new URLRequest(btn_close);
var loader2:Loader = new Loader();
loader2.load(reqButton);
addChild(loader2);
[Code] .....
Once the loader loads my image, and I click on it, nothing is happening. Am I supposed to be adding the EventListener to the loader or something else? How can I detect the height and width of the swf file in the loader?
View 1 Replies
Aug 18, 2010
I have a small issue in ActionScript 2.0. I want to know the stage width and height for external SWF file. I used the following code:
var loader:MovieClip = _root.createEmptyMovieClip('loader', 1);var obj:Object = new Object();var mcl:MovieClipLoader = new MovieClipLoader();mcl.loadClip("external.swf",loader);mcl.addListener(obj);
obj.onLoadInit = function(mc){ trace(mc._width); trace(mc._height);};
It's showing the whole animation's width and height but I want only stage width & height?
View 3 Replies
Jul 14, 2010
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);
View 1 Replies
Feb 17, 2011
Is there a way to know the original width and height of an swf file with java ?
int width, height;
// my stream contains an image or a swf file
InputStream stream = file.getInputStream();
// mediaType has been set with the help of file extension
switch (mediaType)
[Code]...
View 2 Replies
Aug 9, 2010
I use a fileReference.browse() to select an image file from the harddrive.
How can I check the Width and Height of the selected image file?
View 3 Replies
Nov 17, 2003
My Stage size is 126*62. (it's a small animation).- When I publish the .SWF, no problem.- When I publish a projector .EXE file for windows, then, the width is still correct, but the height is higher than 62 : I got two small white bands beside top and bottom of my stage,see ?I don't understand why there's such a difference between publishing a SWF or EXE. And I'm afraid this also happens whatever the Stage size is (small or big, I mean) : you always get these blank bands on the top and the bottom, don't you ?
View 1 Replies
Apr 25, 2002
converting a flash file in to an installable setup file.
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
Jun 12, 2009
i want to load external images of different height and width into same height and width.
View 3 Replies
Feb 24, 2010
i want to load external images of different height and width into same height and width.
View 0 Replies
Mar 25, 2011
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?
View 1 Replies
Apr 7, 2011
1, Is it possible to change the dimensions of a .swf/.fla file once completed?
View 1 Replies
Apr 27, 2009
I've got a movieclip called img_container that holds a draggable image (img_mc) and a mask over img_mc. I can save my img_container out as a transparent png which works great but the issue I have is that the png dimensions are still the size of the original img_mc. I fairly new to AS3 so I'm at a stand still. What I would like to do is save out the bitmap as only the visible area of the masked img_mc. The mask (called myMask) is also draggable and resizable so I'm not sure how to go about saving that specific area only.
View 2 Replies
Nov 19, 2004
i have set up a data validation file in fmx and when the data is valid i want it to go and play the "preview" frame, but if it is not valid i want it to stay on that frame until the person edits it to be valid. i attached the file and can't figure out why my code is not working.
View 4 Replies
Jun 1, 2010
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?
View 2 Replies
Dec 2, 2009
I've been given a Flash file (.swf extension) to put into a web page. Opening the file in my browser makes it quite blurry, so I'm assuming there is a natural size for the file, same as an image.
It's also rectangular so I need to work out the aspect ratio if I don't have an exact size. How would I find this information out?
View 1 Replies
Feb 25, 2010
I'm working with Collada files and I need them to be a certain size. When instantiating them in pv3d you set the filename, materials, and scale. Scale works like a percentage, and there's no way to get the width, height, or depth of the DAE once in flash. I want to be able to specify the size of DAE in 3D space relative to other pv3d native geometry.
View 1 Replies
Oct 3, 2009
I have a Flash file that calls com.plaidfox.MainClass as it's document class (com/plaidfox/MainClass.as). This class has the following code:
ActionScript Code:
package com.plaidfox {
import flash.display.MovieClip;
[Code].....
This code works perfectly the way I want it to. However, I am having a very difficult time splitting this code up. What I want to do is take the function PlantGrass and place it in another action script file [URL] to help organize my functions and classes. I tried putting the PlantGrass function in the second file, but I can never get it to work.
View 6 Replies
Feb 8, 2011
I have an upload form for an image. The user clicks browse and selects a file. How can I get the image dimensions the moment the user selects the file (before the file is even uploaded to the server). It obviously has to be something client-side with maybe javascript/jquery or flash/flex (prefer js//jquery though), but can either of them do this? This is the code I'm using to tie into zozo's getImgSize() function, but it gives me 0*0 as size.
[Code]...
View 1 Replies