Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Using Flex Builder - Setting Stage Width/height


Hi there,

I have recently started using Flex Builder for my Actionscrtipt 3 projects because it is has a much better text editor and is designed around the eclipse framework. However I am having trouble with what should be a simply task.

Flex builder compiles a swf for me from my main application file which is just an .as file. I therefore cannot put a variable reference on my main timeline and pass it through to any of my classes(cannnot do this on main timeline):

Code:
var _stage:Stage = this;
I can acess the stage in one of my classes in order to add a child but cannot set the width and height and Flex seems to automatically compile my swf at 550 * 400.

Code:
public function PropShop(){
nav = new Navigation();
stage.scaleMode = "noScale"; //does work
stage.align = "B";//does work
stage.stageWidth = 990; //not working
stage.stageHeight = 720; //not working
stage.addChild(nav);//does work
}
This is the constructor for my main application class where I would like to initially set the stage width and height. I'm pretty sure you cannot dynamically change the stage dimensions once the swf has been compiled but I don't know how to go about changing them beforehand.

Hope you can help,

Regards,

Gareth.




FlashKit > Flash Help > Actionscript 3.0
Posted on: 03-17-2008, 11:19 AM


View Complete Forum Thread with Replies

Sponsored Links:

Using Flex Builder - Setting Stage Width/height
Hi there,

I have recently started using Flex Builder for my Actionscrtipt 3 projects because it is has a much better text editor and is designed around the eclipse framework. However I am having trouble with what should be a simply task.

Flex builder compiles a swf for me from my main application file which is just an .as file. I therefore cannot put a variable reference on my main timeline and pass it through to any of my classes(cannnot do this on main timeline):

Code:
var _stage:Stage = this;
I can acess the stage in one of my classes in order to add a child but cannot set the width and height and Flex seems to automatically compile my swf at 550 * 400.

Code:
public function PropShop(){
nav = new Navigation();
stage.scaleMode = "noScale"; //does work
stage.align = "B";//does work
stage.stageWidth = 990; //not working
stage.stageHeight = 720; //not working
stage.addChild(nav);//does work
}
This is the constructor for my main application class where I would like to initially set the stage width and height. I'm pretty sure you cannot dynamically change the stage dimensions once the swf has been compiled but I don't know how to go about changing them beforehand.

Hope you can help,

Regards,

Gareth.

View Replies !    View Related
How To Get Stage Width And Height In Flex Builder AS3 Project
I'm using Flex Builder to code an AS3 project that does not use the flex framework. I want to position my elements dynamically based upon the stage width and height. Unfortunately I do not seem to have immediate access to stage properties. The following code shows my problem:

ActionScript Code:
package
{
    [SWF(width='800', height='430', backgroundColor='#000000')]
    public class app extends Sprite
    {
        public function app():void
        {
            trace(stage.stageWidth);         //0
        }
    }
}

Is there an event that gets dispatched when the stage has been created and sized? I've already tried listening for the following events.
Event.RESIZE
Event.COMPLETE
Event.INIT
Event.ADDED_TO_STAGE
FlexEvent.CREATION_COMPLETE
FlexEvent.APPLICATION_COMPLETE

Event.ADDED_TO_STAGE is the only one that gets dispatched, and at that point stage.stageWidth still returns 0.

View Replies !    View Related
[F8] Setting Stage Width / Height?
is there anyway to set the scale of the stage without resizing everything in it?

Like.. change the document size to the monitor resolution without scaling the size of the swf?

View Replies !    View Related
Setting Stage Width And Height
hey there guys,

i wrote a thread similar to this but noone replied so i thought i'd give a better explanation this time...

i would like to create an xml based gallery like this one... http://green.colorize.net/

what i want to know is how they have the background resize to the browser width but have the other objects stay normal and align themselves always on the stage?

basically, as a breakdown here's an example of something similar to what i want to create:
level 1 = stretch to browser dimensions
level 2 (nav and buttons) = dont stretch but align bottom centre
level 3 (logo) = dont stretch but align top left

Does anyone know how this would be done? Am I going completely crazy???!!! I REALLY want to know how this is done, PLLEEEAAASSSEEE help! (noone likes a begger, but i really feel it is necessary! )

View Replies !    View Related
Programmatically Setting Stage Width/height
Is there a way to programmatically lock the width/height of the stage?

I am using Flex, and am fairly new to ActionScript development. Here's an example of the problem that I'm running into...


ActionScript Code:
package {
    import flash.display.*;
    import flash.events.*;
    import flash.text.*;

    public class HelloWorld extends Sprite {
        private var txt1:TextField = new TextField();
        private var txt2:TextField = new TextField();
        public function HelloWorld() {
            keyInit();
            opaqueBackground = 0xFFFFFF;
            this.addEventListener(Event.ENTER_FRAME, onEnterFrame);

            txt1.text = "Text1";
            addChild(txt1);
           
            txt2.text = "Text2";
            addChild(txt2);
        }
        private function onEnterFrame(e:Event):void {
            var speed:int = 5;
            if (keys[37]) txt2.x -= speed;
            if (keys[39]) txt2.x += speed;
            if (keys[38]) txt2.y -= speed;
            if (keys[40]) txt2.y += speed;
        }
       
        // keyboard event handling
        private var keys:Array = new Array(256);
        private function keyInit():void {
            stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDown);
            stage.addEventListener(KeyboardEvent.KEY_UP, keyUp);
        }
        private function keyDown(e:KeyboardEvent):void {
            keys[e.keyCode] = true;
        }
        private function keyUp(e:KeyboardEvent):void {
            keys[e.keyCode] = false;
        }
    }
}

Here is what it looks like on initial load:


Here is what it looks like after moving txt2:


All references I found regarding this issue talk about changing the properties within Flash. Since I am using Flex as an IDE, I would like to know if there is a way to programmatically specify width/height for the stage via ActionScript.

This throws an error:

ActionScript Code:
stage.width = 500;
stage.height = 500;

This appears to shrink the display down to the size of a 1x1 pixel...

ActionScript Code:
this.width = 500;
this.height = 500;

Any ideas?

View Replies !    View Related
Setting Movieclip Height And Width On Stage When Dragged
actionscript Code:






Original
- actionscript Code





init();
function init():Void
{

sunobj._x = 70;
sunobj._y = 78;
sunholder._x = 568.1;
sunholder._y = 102;



sunobj.onPress = function()
{
sunobj.startDrag();

}



}

function onEnterFrame():Void
{

if(sunobj.hitTest(sunholder))
{
stopDrag();
sunobj._x = sunholder._x;
sunobj._y = sunholder._y;
}
}







 init();function init():Void{            sunobj._x = 70;        sunobj._y = 78;        sunholder._x = 568.1;        sunholder._y = 102;                    sunobj.onPress = function()    {        sunobj.startDrag();            }                } function onEnterFrame():Void{        if(sunobj.hitTest(sunholder))    {        stopDrag();        sunobj._x = sunholder._x;        sunobj._y = sunholder._y;    }}        





code is posted above. The problem i am having is i want to change the height and width of the movieclip on stage when dragged and im not sure of the code needed to do it.

I have just started learning actionscript so im pretty new to it.

ultimately what i want to do with the piece of code is to drag a smaller object change the size of the object whilst it is being dragged and then when it is dropped onto a larger object of the same shape the height and width of the smaller object are the same as the larger object

i can explain if nobody understands what i mean

if someone could help that would be great thanks

View Replies !    View Related
Setting Min. Width/health In Flex 3
Sorry if this is the wrong forum, didn't see one for flex though, and it is flash, so...

Anyways, I started a project in flex, added a few controls to it. Tested it and it seems to be opening too small. I set the min. width/height to 800,600... it's still opening in the same size. Is there any reason it would be doing that. The project I created is for html, but what I'm talking about is when I'm opening just the .swf file. If it's set for html, will those settings not work? Do I have select it as an AIR project when creating the project to get those settings to work? The end result of the project will be an AIR application, so it doesn't really matter, I was just kinda messing around with flex for now, so I was curious.

Thanks.

View Replies !    View Related
Stage.width && Stage.height Doesn't Work Anymore?
How do you get Stage.width and Stage.height in ActionScript 3.0

2.0 this works like a charm. I guess they may have moved this inside a deeper class or something.

thanks in advance.

View Replies !    View Related
Stage.width And Stage.height Not Matching Document Settings?
Ok, so I have no idea why this would be happening and its driving me nuts. I have my Flash movie size set to 960x650. However, when I trace stage.width and stage.height, I get:

950.05x630

Why in the world would this be happening? It's screwing up all the work I'm trying to put into positioning elements relative to the stage size. Thanks for any help!

View Replies !    View Related
Setting/Getting FLV Height And Width
Is there a way to retrieve and set the height and width of an FLV/Playback object via actionscript? I was hoping I could interact with the values via simple _height and _width properties, but that seems to offer all kinds of unexpected results in Flash (like reporting width in the thousands when the width is actually under 300, etc... height seems much closer to reality, but still off.)

View Replies !    View Related
Stage.height And Stage.width Erratic Values?
Hey folks,

I was wondering if it happens in all Flash everywhere, or just in mine:

When I trace Stage.height and Stage.width, I always get erratic values:

Stage.height gets me always 4 pixels less than real
Stage.height gets me always 104 pixels less than real

This, way if my stage has 760 x 400, it will return values 756 x 296.

Anybody knows why?

Thanks!

View Replies !    View Related
Stage.width, Stage.height, Add.Listeners Problem
Hi
i found the way yesterday to ensure my mc stays full screen. now i want to animate the same mc if i can in reaction to a button click.

not sure how this next step goes. do i need another addlistener to the background mc that im tweening ?

kindly check the .fla. to see what i mean.
its very rough cut but hopefully you can get the gist of it.
when the text button is clicked, the bg reverts to the top left of the screen.

thanks
-dj

View Replies !    View Related
MX2004 -- Stage.height And Stage.width Different From Mac To Windows
I have a really strange problem that is ruining my movie. I have set the size of the stage to 450px by 400px in the properties dialog. In my actionscript, I've got all kinds of things that rely on Stage.width. So, I developed everything in MX2004 on Mac, and everything worked swimmingly. So, I opened up the exact same file in MX2004 and everything is placed wrong on the stage. So when I did a trace of Stage.width, I got 940px, and a trace of Stage.height gave me a figure of 763 pixels. If I do the same traces on the Mac, I get what I expect, 450px for width and 400px for height. Does anybody have any ideas as to what might cause this kind of discrepancy?

Thanks,
John

View Replies !    View Related
Setting URL Width,height, X And Y Position
Hello all,

I am new to Flash CS3 and trying to resize a URL. Please assist:


Code:
appload.addEventListener(MouseEvent.CLICK, application);
function application(Event:MouseEvent):void {
var request:URLRequest = new URLRequest("http://www.google.com/");
navigateToURL(request);
}
the URL is opening, but I need to resize it and set the x/y position. Please help :-)

View Replies !    View Related
Setting Document Width And Height From XML
Hi!

I'm trying to figure out if this is even possible. I want to upload an xml file with my swf and have my XML set the swf's width and height. So if I know my viewers will have a screen resolution of 800 x 600, then I can set my swf to fit their browser's window from the XML itself. Some have suggested making it autosize for the browser, however I don't want to do that. I would like to be able to set it from an XML file...

Thanks!!!!!!!

Kal

View Replies !    View Related
Setting Browser Width/height?
Backstory:

I built out a scrolling Flash application that currently resizes the browser to whatever the full-screen res of the user's monitor is... I'm kind of indifferent about it.

Anyhow, I'd like to be able to set the browser size to a specific height / width instead of taking up 100% of the user's screen real-estate.

Is there a "correct" way of doing this with actionscript?

View Replies !    View Related
Setting Width And Height Of A Movie Clip
I want to dynamically load JPGs in to a movie; there are going to be 1000's of JPGs that vary in size. The JPG will load when the user selects which image to load and it will have a drop shadow (mc) that changes to the same dimensions as the loaded image, offset maybe 10 pixels.

I have started by creating an empty mc when the user clicks on a button. A JPG is then loaded into that mc. The drop shadow is a graphic symbol within an mc named 'shadow_mc'. This is initially set to not be visible, but becomes visible after loading the JPG. The code I am using is below:

----------------------------------------------------

on (press) {
_root.createEmptyMovieClip("holder", 1000);
holder.loadMovie("myPic.jpg");

_root.shadow_mc._visible = 1;

_root.holder._x = 10;
_root.holder._y = 10;

imageWidth = getProperty(_root.holder, _width);
imageHeight = getProperty(_root.holder, _height);

_root.shadow_mc._x = _root.holder._x + 10;
_root.shadow_mc._y = _root.holder._y + 10;

_root.shadow_mc._width = imageWidth;
_root.shadow_mc._height = imageHeight;
}

----------------------------------------------------

The problem comes when trying to set the properties of the 'shadow_mc'. Setting the x and y values is no problem and I can offset the mc that holds the drop shadow (+10). However when trying to match the drop shadow to the dimensions of the image I cannot get it to work.

First I tried:

_root.shadow_mc._width = _root.holder._width;
_root.shadow_mc._height = _root.holder._height;

but this did not work so I have used getProperty in the above code and assigned the results to variable names to try and set the shadow width and height to match, but still no luck. In fact when I use _width and _height the shadow cannot be seen at all.

Finally any other suggestions on how to approach this and I read that I should make sure the image is loaded before doing anything with it, how do I do that?

TIA,

Adrian.

View Replies !    View Related
Problem Setting Presentation Width And Height
Hi

I am using flash MX for designing presentations instead of using powerpoint.
my problem is the presentations designed in powerpoint fits(occupies the whole screen of the monitor).but if i design in flash it is not the same case, i would like to have my presentation as the powerpoint does.
i am using FS command to show fullscreen and not allowing to scale since i may be using raster graphics in my presentation.
how can i solve this problem?
Any help is appreciated.

GugZ
India

View Replies !    View Related
Setting Width And Height Acting Weird
I am loading flash 4 movies with a Flash 7 fla. I have a predetermined size for the movies that is smaller than the original size. When I set the _width and _height properties on the flash 4 movies, the _xscale and _yscale change to a very large number. In turn, the _width and _height change as well and I end up with a flash 4 movie that is scaled to some huge number. I have some other flash movies that I can set width and height on and have no issues. Is this:
1. a bug with flash 4 ?
2. a problem with the original flash 4 files.. the way they were written?
3. something I am just missing?

please let me know.

View Replies !    View Related
Problems Setting MovieClip Height And Width
Hi all,

Im having a bit of trouble setting the height and width of a movie clip in my AS3 class. I have created a new variable for my object, which extends the MovieClip class, but i cant seem to change the height or width of this object!!!
Other properties like x,y,alpha etc. can all be changed and work fine. I tried to use scalex and scaley but i really need to be able to set a specific height and width.

the code i have so far is:


ActionScript Code:
var galleryImage:GalleryImage = new GalleryImage() //GalleryImage extends the MovieClip class
var loader:Loader = new Loader();
galleryImage.addChild(loader); // add loader to galleryImage object
var request:URLRequest = new URLRequest("URL here");
loader.load(request);

galleryImage.height = 100;
var heightDiff:int = imageHeight - 100; // imageHeight is set earlier... lets say its 600.
var percentDiff:int = (imageHeight / 100) * heightDiff;
galleryImage.width = (imageWidth / 100) * percentDiff;

addChild(galleryImage); 
galleryImage.x = 100;
galleryImage.y = 100;

Now when i run this, nothing happens. Without setting height and width it displays an image, but as soon as i try and change height and width it the image doesnt show. I traced the height and it said it was 0.

If any one has any idea how i can set the height or width that would be a great help!!

Cheers for your time
Fish

View Replies !    View Related
Stage.width & Stage.height Problems
Why is it when I use this script attached to an empty movie clip the box seems to always be short on the height side? The width is fine. See attached FLV.

frame.fla.zip

Thanks in advance for any feedback.


Code:
onClipEvent (load) {
this._x = 0;
this._y = 0;
this.moveTo(0, 0);
this.lineStyle(1, 0x000000, 100);
this.beginFill(0x000000, 0);
this.lineTo(Stage.width-1, 0);
this.lineTo(Stage.width-1, Stage.height-1);
this.lineTo(0, Stage.height-1);
this.lineTo(0, 0);
this.endFill();
}

View Replies !    View Related
Stage.height & Stage.width Return 0
First, hey there, cool forum. This is my first post...anyways...

I'm having what, I want to assume, is a common issue and there's something I'm missing here...I have a flash movie that works fine (that is Stage.height and Stage.width) return their proper values when the actual SWF is played in the flash player, however, when I put the movie into an HTML page and set it's height and width to 100%, Stage.width and Stage.height are 0 and my neato script breaks.

I realize I'm scaling the movie, but it seems to me that Stage.width and Stage.height should work regardless...and the fact it gives me 0 is even more odd, as though it's not working at all.

View Replies !    View Related
Getting And Setting The Width And Height Of Text Tool Dynamically
What I am trying to do is set the text of a text tool at runtime, which I was able to do. The problem is how can I determine if the text exceeds the size of the text tool and how to resize it at runtime.

View Replies !    View Related
Setting An Empty Movieclip Default Width/height
Hey'a,

I have a movieclip with the instance name of "container_mc" that I am loading a external swf file into.

When I trace(container_mc._width) after the preload it returns 0.

Is there any way to tell the movieclip to stay at a width of 760px and a height of 460px regardless of the content that is loaded?

Reason being, I then have a function that positions the container_mc movieclip in the center of the stage based on the Stage.width/height..

The only way I have been able to get this to work thus far is to have a 760px by 460px square shape, position the movieclip.. then load the content to replace the square shape however I'd rather be able to default everything without having to do that.

Anyone know how?

Cheers,
Ryan

View Replies !    View Related
How Do I Get Stage Height And Width In 2.0?
In 1.0 it was stage.height, but I try it in 2.0 and when I trace it, I get "undefined".

trace(stage.height);

What am I doing wrong?

View Replies !    View Related
Stage Height/Width
I have searched, and for some reason, I cannot get this.

I want to get the width and height of the stage, and set one of my objects to that height and width...

I currently have this:


ActionScript Code:
videoP.height = Stage.stageHeight;
videoP.width = Stage.stageWidth;

View Replies !    View Related
Stage Height And Width
can I define some properties of the Stage, like width, height or the background color, by actionscript?

View Replies !    View Related
Stage.height And Width
Code:

this._x = 0 - (Stage.width - 780)/2 + 20;

this._y = 0 - (Stage.height - 570)/2 + 20;

This will give me top and left site 20px away..
How do i fix this for bottom and right side.

And the 2nd Question is.

Is there a solution to call for example 5 swf's and give him
something like width = 20%

Hope you know what i mean.

Greetz://

View Replies !    View Related
How To Set The Stage Height And Width?
Hi All,
Is it Possible to Set the Height and width of the Document at Run time? Like winowstate =maximized in vb
Thanks in advance

View Replies !    View Related
Stage.width And Height
I've set the stage to 640x400 and when i call Stage.width it returns 636...weird.

Has anyone encountered the same problem?

jtax

View Replies !    View Related
Stage.height & Width
i have built a site that launches a full screen flash site (no scale) and positions a bunch of mc in relation to the full screen.

everything works fine until you reload the page in IE 6 on the PC. the file forgets what the stage.height and stage.width are and loads the movie to the size of the main.sfw size. this only happens (as far as i can tell on IE on the PC). other browsers and platform work as they should.

any fixes?

View Replies !    View Related
Stage.height And Width
Code:

this._x = 0 - (Stage.width - 780)/2 + 20;

this._y = 0 - (Stage.height - 570)/2 + 20;

This will give me top and left site 20px away..
How do i fix this for bottom and right side.

And the 2nd Question is.

Is there a solution to call for example 5 swf's and give him
something like width = 20%

Hope you know what i mean.

Greetz://

View Replies !    View Related
Stage Width And Height Bug
I have a flash app I'm building that needs to know the stage width.

In firefox I ahve no problems, but in IE6 and 7 if the cache in not cleared the stage width turns to 0.

Here's my action script code:
Code:

      private var swfStage:Object;
      
      private var stageWidth:Number;
      private var stageHeight:Number;
      public function Personalize() {
                        swfStage = stage;
         swfStage.scaleMode = StageScaleMode.NO_SCALE;
         swfStage.align = StageAlign.TOP_LEFT;
         stageWidth = swfStage.stageWidth;
         stageHeight = swfStage.stageHeight;
                        debugTxt.text = swfWidth;
                 }


I'm embedding my swf with swfobject, been doing so for a while and never ran into this problem!!! It's the weirdest thing. It just started to happen out of the blue as well.

In Firefox I can reload etc and everything is fine.

In Internet Explorer however, it breaks after loading it once. The first time the stage width is properly read, but if I browse to a different page (with the swf on that page as well) the stage width becomes 0.

Any help would be greatly appreciated.

View Replies !    View Related
Stage Width/height Problems
Ok, I'm checking the docs for my latest MX '04 Pro, and it looks like I can set the Stage to fit ust about any way I want. However, I have a little problem.

I'm using a base, "bootstrap" type of SWF to do some XML loading, skin load, parsing, etc. While this is going on, I create a text field that displays the current status of things, and it need to fit the stage. The skins can be any size, or the SWF may need to fit in dimensions that don't match the published dimensions of the base SWF.

Is there a way to get the width/height as set by the HTML?

View Replies !    View Related
Variables For Stage Width And Height?
OK, I've been running through some logic where I compare the height and width of a movie clip with the height and width of the stage.

I was ASSUMING that I could reference the stage's width and height with:

stage._width and stage._height

But this isn't working.

Tried:

_root.stage._width and _root.stage._height

and

stage.width and stage.height

But a "trace" keeps showing these variables as "undefined".


What syntax should I be using ?


-= Dave =-

View Replies !    View Related
Stage Height Width Problem
Hi Everyone ,

I am quite new to Flash ,

I have made one flash swf in flash cs3 using action script 2 .

My requirment is like this -
if client's resolution is less than or equal to 1024*768 i have to show scroll pane of size 410 and when resoution is higher
than this i have to show scroll pane of size 540 . _x and _y of scroll pane is 0,0 all other things on flash is relative to this scroll pane so they take their _x and _y accordingly .(By the way i have only more movie clip on stage that is of height 160)

I have used System.capabilities.screenResolutionX and System.capabilities.screenResolutionY to detect resolutions
and have made scroll pane and movie clip to render accordingly .

Now my problem is that there is no way i can change the size of stage dynamically as height and width of stage is read only (correct me if m wrng ) , so if i take my stage size ,according to hight resolution ie scroll size(540) + moviecilp size(160) , 700 and when it is displayed on low resolutions it has white space of around 130 pixels and html content which is just below where my SWF ends looks far below where it is required .

and if i do viceversa ie i make stage 410+160 than it truncates my SWF on high reolution .

Is there any workaround for settings stage height and width dynamically or something to do with PUBLISH settings .

Kindly help , my project deadlines are very near .

Please help

Thanks in advance

View Replies !    View Related
Add.Listeners, Stage.width / Height Query.
hello
i found the way yesterday to ensure my mc stays full screen. now i want to animate the same mc if i can in reaction to a button click.
im still looking to get somewhere in the same world as this site
www.2210media.com

not sure how this next step goes. do i need another addlistener to the background mc that im tweening ?

kindly check the .fla. to see what i mean.
its very rough cut but hopefully you can get the gist of it.
when the text button is clicked, the bg reverts to the top left of the screen. i want to keep the bg as a full screen mc. not sure how to do that.
-thanks for your help.

View Replies !    View Related
Stage.width/height & Drawing Problems
I want to draw a line around the stage to form a border, but the code below produces a square just a bit shorter and smaller then the stage size. Why is this?


Code:
this.createEmptyMovieClip( "mShape", this.getNextHighestDepth() );
mShape.lineStyle(2, 0, 100, false );
mShape.lineTo( 100, 0 );
mShape.lineTo( 100, 50 );
mShape.lineTo( 0, 50 );
mShape.lineTo( 0, 0 );

onEnterFrame=function()
{
mShape._width = Stage.width;
mShape._height = Stage.height;
}
Also when I resize the stage, the 0 coordinate seems to have an relative position(?), wich causes the border to move as well. How can I prevent this behaviour?

View Replies !    View Related
Dynamic Movies Stage Width/Height?
Is there a way to find a dynamically loaded movies Stage width. I don't want to know what the actual movie width is (cause you can have Movie Clips that are off stage that will increase the size of the clips)?

-Ryan

View Replies !    View Related
Dynamic Movies Stage Width/Height?
Is there a way to find a dynamically loaded movies Stage width. I don't want to know what the actual movie width is (cause you can have Movie Clips that are off stage that will increase the size of the clips)?

-Ryan

View Replies !    View Related
Height And Width Params And Stage Dims
Is it possible to have Flash animations automatically resize themselves on a web page to the dimensions set for the stage, rather than having to specify the height and width values in the HTML? Right now, without width and height params, it seems to default to about 150x150 even though I set the stage to 400x400.

View Replies !    View Related
[as] Stage.width, .height Prob (can Anyone Dupe?)
Create a brand, spankin' new FLA.

In frame one, add the following script: trace(Stage.width); -- or you can trace the height, it doesn't matter.

CTRL-Enter to create your SWF and see the width/height in the Output window. Now CTRL-Enter again, as many times as you like. If you're like me, you'll see your width or height change drastically after the first output. It stays consistant after the first output, but consistently wrong.

Anyone know what's going on?

View Replies !    View Related
Can I Change The Stage Height And Width With Actionscript?
can i change the stage height and width with actionscript?

View Replies !    View Related
Stage.width, Stage.height
Does anyone know why the stage dimensions are coming out wrong. I have a movie set at 800 x 600. I do trace(Stage.width);
trace(Stage.height); and get 796 and 596. What's going on here? I have seen at least one other post with the same issue, but there were no responses.

Best regards...
Lance

View Replies !    View Related
Stage Width Vs. Stage Height
hello.
still looking how to maintain max. stage width and height. i have managed to achieve it on the width, but for some reason have been unable to do it for the height. that is, i have managed to make a line go from one side to the other (almost) but cant figure out how to do it on the vertical.
zbot is the horiz line at the botton
ztop for the one above
the problem, is for xleft (the vertical lineon the left)
i have included what i think to be the nearest code yet, and a fla.

any help, thanks a lot.




Code:
Stage.align = "LT";
Stage.scaleMode = "noScale";
bg._width = System.capabilities.screenResolutionX-20;
bg._height = System.capabilities.screenResolutionY-70;
bg.onResize = function() {
this._x = (Stage.width-this._width)/2;
this._y = (Stage.height-this._height)/2;
};
Stage.addListener(bg);
zbot._x = 62;
zbot.onResize = function() {
this._width = Stage.width;
};
Stage.addListener(zbot);
////
xleft._x = 270;
xleft.onResize = function() {
this._height = Stage.height;
};
Stage.addListener(zbot);
////
ztop._x = 62;
ztop.onResize = function() {
this._width = Stage.width;
};
Stage.addListener(ztop);
// get the content clip to stay fixed horizontally centred
content.onResize = function() {
this._x = (Stage.width-this._width)/2;
};
Stage.addListener(content);
// manually invoke the onResize events for the clips to start things off
bg.onResize();
zbot.onResize();
ztop.onResize();
xleft.onResize();
content.onResize();

View Replies !    View Related
Stage.width Stage.height Help
I have the main swf(main) which loads in another swf(loaded). The loaded swf looks at the main swf for the Stage.width and height.

Is there a way for the loaded swf to look at its own Stage.width and height and not main?

View Replies !    View Related
[AS] Stage.width & Stage.height
Is it possible to dynamically adjust the Stage.width / Stage.height properties. As an example, my author time stage settings are at 700 by 500. Based on what I pulled from database, is it possible to resize the dimensions of the root swf based on the content which is tabulated into the data ?

View Replies !    View Related
Stage.width & Stage.height
Can someone please look at my code and point out the obvious where I cannot see?

Everything seems to be working correctly with the exception of the Stage.width and Stage.height properties the pictures float off the stage.

Code:

import mx.transitions.Tween;
var photoScale = 30;
var photoAlpha = 60;
var clipWidth = 380;
var clipHeight = 300;
var flyerInit:Object = Object();
randomize = function (min:Number, max:Number):Number
{
   var range = max - min;
   var resultRandom = Math.random() * range;
   resultRandom += min;
   return resultRandom;
};
flyerInit.onEnterFrame = function()
{
   this._x += this.speedX;
   this._y += this.speedY;
   this._rotation += this.speedR;
   if (this._x < 0 || this._x > clipWidth)
   {
      this.speedX *= -1;
      this.speedR *= -1;
   }
};
if (this._y < 0 || this._y > clipHeight)
{
   newFlyer.speedY *= -1;
   newFlyer.speedR *= -1;
}
flyerInit.onRelease = function()
{
   if (!this.select)
   {
      this.speedX = 0;
      this.speedY = 0;
      this.speedR = 0;
      var locxTween:Tween = new Tween(this, "_x", non, this._x, clipWidth / 2, 1, true);
      var locyTween:Tween = new Tween(this, "_y", non, this._y, clipHeight / 2, 1, true);
      var rotateTween:Tween = new Tween(this, "_rotation", non, this._rotation, 0, 1, true);
      var scalexTween:Tween = new Tween(this, "_xscale", non, this._xscale, 100, 1, true);
      var scaleyTween:Tween = new Tween(this, "_yscale", non, this._yscale, 100, 1, true);
      var alphaTween:Tween = new Tween(this, "_alpha", non, this._alpha, 100, 1, true);
      var newDepth = this._parent.getNextHighestDepth();
      this.swapDepths(newDepth);
      this.select = true;
   }else {
      this.speedX = randomize(-2, 2);
      this.speedY = randomize(-2, 2);
      this.speedR = randomize(-2, 2);
      var scalexTween:Tween = new Tween(this, "_xscale", non, this._xscale, photoScale, 1, true);
      var scaleyTween:Tween = new Tween(this, "_yscale", non, this._yscale, photoScale, 1, true);
      var alphaTween:Tween = new Tween(this, "_alpha", non, 100, photoAlpha, 1, true);
      this.select = false;
   }
};
for (var i:Number = 1; i < 9; i++)
{
   var newPhoto:String = "p" + String(i);
   var newName:String = "flyer" + String(i);
   var newDepth:Number = this.getNextHighestDepth();
   var newFlyer = this.attachMovie(newPhoto, newName, newDepth, flyerInit);
   newFlyer._xscale = photoScale;
   newFlyer._yscale = photoScale;
   newFlyer._alpha = photoAlpha;
   newFlyer._x = Math.random() * clipWidth;
   newFlyer._y = Math.random() * clipHeight;
   newFlyer.speedX = randomize(-2, 2);
   newFlyer.speedY = randomize(-2, 2);
   newFlyer.speedR = randomize(-2, 2);
   newFlyer.select = false;
}



please help

thanks,

tmo

View Replies !    View Related
Dynamically Sizing Clip To Stage Width+height
so i guess what the real question is is how would make the movieclip smart enough to know when its reached the top of the stage and bottom from different positions on the stage.

i have a button that is duplicated three times one after the other. so when they resize even though they are now equal to 600 in height (my stage is 800x600) they are not positoned isnt equal to the top and bottom of the stage.

here's my code as it stands now:

sW=Stage.width;
sH=Stage.height;

fillScreen= function (clip) {
speed = 4;
clip.onEnterFrame = function() {
this._height += (sH - this._height)/speed;
if(Math.round(this._height) >= sH){
this.onEnterFrame = null;
trace(this._name+" equals null");

} else {
trace("AAA" + _parent._name + "not equal to stage");
trace("BBB" + "sH value: " + sH);
trace("CCC" + "this._height equals: " + this._height);
}
};
};
i hope that makes sense
thanks for the help

erase

View Replies !    View Related
Papervision, Stage.width Height, Plane And Z Distance ...
Hello all,

I would like to ask for a help

I am doing some test in papervision and I would like to ask if somebody knows some function.

I have camera.zoom = 11,
I have camera.focus = 100,
I have camera.z = -1000
the default position...

I am putting plane on stage with
plane.width = stage.stageWidth;
plane.height = stage.stageHeight;
plane.z = 0;

this the plane fill the screen absolutelly...

BUT what about i am moving the plane 800 behind let say...

plane.z = 800; The plane will became smaller...

I would like to be able to count the size of this plane to fill the screen in this position...
like plane.z = 800;
plane.width = stage.stageWidth * (same formula depending on camera focus and zoom) to fill the screen;
plane.height = stage.stageHeight * (same formula depending on camera focus and zoom) to fill the screen;

What I am trying to do is to count the "virtual stage width and height" depending on camera zoom,focus and the distance...

THANKS FOR HELP...

View Replies !    View Related
Setting A Movieclip To The Height Of The Stage
Why doesn't this work in as3.0? The movie clip box should expand but instead remains its same short height.

ActionScript Code:
cp.box.height = stage.height;

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved