Actionscript 3.0 :: Sizing A Movieclip To Stage Width And Animating?
Jun 13, 2011
I'm working on a fullscreen site for a client. I have a rectangle movie clip that needs to match the stage width and then animate across the stage. Here's the link to the current non fullscreen page,[URL] I need the gray bar to go all of the way across the screen. Here is the code I'm using to fullscreen the site:
Code: Select allfunction stageResize(e:Event):void {
var sw:int=int(stage.stageWidth);
var sh:int=int(stage.stageHeight);
[code]...
use code to set the registration point to the top left and position it to the left of the stage, then set the width to match the stage, and then animate it across the stage, but I'm not sure if that's right or how to do it if it is.
I've set the publish settings to 100% width and 100% height and have then added the 'noScale' function into the first frame of my timeline. Here is an idea of what I'm trying to create:
I have three movieclips that are touching the left side of the Stage and want them to touch the left side of the browser but centre vertically. I can do this by adding the 'Stage.align = LC' command, but not sure if this is the right way to go about it.
The movieclip that is on top contains a logo and I want it to have a fixed size. I called the instance name 'logo_mc'.
The movieclip below 'logo_mc' is called 'container_mc' and is a strip of photographs that I need to run from the left to the right side of the browser no matter what the browser size. I need this movieclip to scale proportionally up and down as they viewer resizes their browser so the first photo is touching the left side of the browser and the last picture is touching the right side (without distorting).
The final movieclip is called 'buttons_mc' and is right below the 'container_mc' clip. This movieclip needs to remain a fixed size.
Obviously when the 'container_mc' clip resizes I need the other movieclips to move up and down to stay the same distance above and below the 'container_clip'.
I have a Movieclip on stage with nested movieclips inside. All referenced at 0,0. None of the child movieclips load any dynamic content, animate or have Masked Layers. It does have an input textfield in one of the child MCs. The parent MC shows 280 px width, while it returns 313 px with a .width trace. There is no code that alters the .width value of the parent MC at run-time. And the ParentMC on stage is not scaled (it is at 100% width/height)
how to get a movieclip named "topnav" to resize it's width to match that of the stage. I am trying to resize the width of a top nav bar across a resizable RIA. I have started with the following code but with only partial success:
Code: stage.addEventListener(Event.RESIZE, resizeListener); function resizeListener (e:Event):void { var reg2 = stage.stageWidth / 100;
For my menu on my page, I want to do things dynamically. For the drop down menu, I want to have a box around the link when moused over, that changes depending on the number of characters that are going to be placed on it.
[URL]
See how the "tab" around team is smaller than the menu? But GRAPHICS will be larger, and so on.
I'm parsing an XML file to pull in the data for the menu, so I want to handle this portion dynamically as well.
I want to put together a flash gallery of photography for my photography business. I am very good at Photoshop design, html, css, javascript but I am a novice with flash. I can use it and use some actionscripting but my knowledge is limited.
I see galleries like this one: [URL]
The images expand and contract perfectly as the browser is resized. I am used to having to size pics for the lowest res screens (I design for 1024 width resos's usually).
What size should I make pictures to work like this... Does flash scale them down / up / either... are there quality issues with letting flash manage the sizing.
Is there any performance difference? I am scaling a 2000 - 4000 wide movieclip, within a 600 wide stage. Does it matter which way I scale it in terms of CPU usage; myMovieClip.scaleX *= 2; or myMovieClip.width *= 2; The movieclip will be scaled multiple times and to varying sizes.
I just did two 100% Flash sites. I always size my sites 1024 by 768 or a bit smaller. I have never had a problem with it not fitting in the browser. I exported with Flash HTML at 100%, no scale.I tested these sites on Safari and IE on different monitor sizes. They looked great.
Both of my clients are using Firefox said it cuts the bottom off by about and inch or so. I did some research and this seems Firefox does this. I read this article below and wanted to know the following:[URL]
1 - Is this the best way to fix it? Or have I developed these sites too big for FF.
2 - Is there something else I could do (i.e. export the HTML a different way?).
3 - Should I size differently in the future?I would like to prevent me having to resize the stage and change all the objects.
I have a problem animating the preloader of the site I've been working on. I want a movie clip (a dark grey rectangle) to start at width = 0 and then extend to the width of the stage. But it just doesn't move, it preloads perfectly but doesn't really extend with the progress event.
Here's the code: loadBar_mc.width = 0 var l:Loader = new Loader(); l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop); l.contentLoaderInfo.addEventListener(Event.COMPLETE, done); l.load(new URLRequest("Bnaider.swf")); function loop(e:ProgressEvent):void { [Code] ..... [URL]
I know normally if I want to center a movie clip I would
mcName._x = Stage.width / 2; or * 0.5; mcName._y = Stage.height /2; or * 0.5;
my problem is I'm using a component that changes the width and height, but the real problem is that the registration point of the component is the top left. I know I seen code somewhere that gets the width of the movieclip, figures out where the center is then positions it accordingly but I'm not quite sure how it's done.
i have a working clip of for aligning to bottom right corner of of stage, and i want it to be loaded in from another swf... swf loads fine etc, just when it loads it the MC in question does not move at all?
Code: Stage.align = "TL"; Stage.scaleMode = "noScale"; var presenter:MovieClip;
I have a Flash CS4 document and I am attempting to resize the stage to accomodate its current contents.When I do so, the stage becomes *much larger* than the apparent contents, and I am trying to figure out why. I have literally examined every frame of the animation, and selected every individual object to see if the selection bounds indicate a rogue "large object"...but none indicate this...what sort of things about the contents might cause this that I am missing?
I'm adding text to a movieclip as you can see below. The text is alomost not visible because it's so small. If I don't scale the movieclip then the text becomes clipped. I basically want the movieclip to be a tight container (the same size as the textfield) for the Textfield. The below does not work. How can I do this?
is there a way to make a minimum width and stop resize? I have a menu I am building that is locked to the bottom of the browser and 3 buttons on the left and a movieClip on the right. When you resize the browser window - currently - you can make the button on the right sink under the three on the left.
trace ("The Width is: " + stage.width + "."); trace ("The Height is: " + stage.height + "."); The Width is: 0. The Height is: 0. Why is it Zero instead of the document's size ?
I was wondering if it was possible to motion tween an flv while it's playing? So far I can mask the flv with an animated object, animate objects behind the video, and in front. I tried animating the video itself and as soon as the movie plays in preview the animation stops.
I mean only ActionScript. Is that possible to animate an object so that it moves on pre-drawn in Flash Professional trajectory? I know, I can use onEnterFrame with some math equations to move object around, but what if trajectory is too complicated? You see, I don't even know how to formulate the question.
The basic area: add 5 circles on random locations on stage... and animate them to random locations on stage without touching each other...
The problem:: The code below works perfectly (up to a certain point). It succeeds in making the circles animate to random points on stage. It also succeeds in detecting if once circle comes to close proximity with another circle... Code on main timeline:
Code: var enemyArray:Array = new Array(); var timeToCreateEnemy:Timer; // set up timer that will fire every 2 seconds, 5 times timeToCreateEnemy = new Timer(2000, 5) timeToCreateEnemy.addEventListener(TimerEvent.TIMER, createEnemy); timeToCreateEnemy.start(); [Code] ......
I am trying to make the sleigh bell sound stop when my object(santa) reaches the end of stage. First of all, I don't exacly know how to write an if statement, second I get an error when I try to stop the sound.
var mySound:Sound = new bellsSound(); mySound.play(); var myTween:Tween = new Tween(santa, "x", Regular.easeOut, -100, 810, 25, true); addChild(santa);
add 5 circles on random locations on stage... and animate them to random locations on stage without touching each other... THE PROBLEM: the code below works perfectly (up to a certain point)... it succeeds in making the circles animate to random points on stage... it also succeeds in detecting if once circle comes to close proximity with another circle... only problem is, i dont know what i should do next...
When you resize the browser window the thumbnails rows and columns adjust accordingly to fit.I've managed to attach the thumbnails correct when my enableButtons() function is called but i'm unsure how to approach resizing.
Stage.align = "TL"; var numberOfGalleries:Number = 20; var thumbMarginX:Number = 163; var thumbMarginY:Number = 109;
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...
In as3 What is the difference between calling stage.width and stage.stageWidth I read somewhere that if we have nothing on stage then the value of stage.width is 0,but what happen when I have nothing on stage but loading contents dynamically on stage?I have tried this and when i have loaded content dynamically on stage then i have got
stage.width=value; // where value is dynamic number
In actionscript 3 (as3) What is the difference between calling stage.width and stage.stageWidth. This was something I remember I got confused about in the past (Adobe's api docs are an artform in obfuscation
I was wondering if any of you can spot the error in my code? I got a bunch of objects called 'jelly' that are gonna bounce around my screen but the problem I got is they don't bounce at all! they just run straight off. And yeah I'm very new to actionscript, can anyone see what I'm doing wrong here?
i am using a movieclip who has two nested movieclips, the problem i am dealing is that when i try to get the width or height of the parent movieclip it always showing the values of the small nested movieclip, when i draw the movieclip it draw perfect but when i read this values shows that error, what can i do?
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.