ActionScript 3.0 :: Scaling A Movieclip Without Scaling Its Contents
Apr 10, 2009
I am trying to achieve an effect of scaling a movie clip on click...very similar to [URL] When the user clicks on See, Hear, Play and Shop boxes, the boxes expand. I have created a box movieclip that has a bar on top. This bar is a movie clip inside the box movieclip. When i try to scale the main box movieclip, the internal bar movie clip scales as well. How to stop this?
i have a diagonal movieclip that I am trying to scale along with the background video. The background video scales perfect, I am attaching the diagonal movieclip (br in the code as bottomright) with addChild Instead of scaling with the window, it seems to repeat such as the image is displaying. this is the main section of the code that is doing the scaling
var br:mc_bottomright = new mc_bottomright(); addChild(br); //proportional scale if ((stage.stageWidth / stage.stageHeight)> (owidth/oheight))
I'm working on an AS3 project whereby an element needs to expand (downward) on hover. The problem is that I can't figure out how to expand the element without AS3 auto-scaling all of it's contents. For example (this is a Sprite):
[Code]...
Will automatically grow all children of this to fill the available space. I'm looking to disable this functionality, leaving the previously visible content in-place, so that I can reveal additional content with the new space. Playing with scaleY in the TweenLite statement doesn't seem to do anything.
It doesn't make any sense to me why this is the default behavior, but I come from an HTML (think "box-model") layout mindset, so I think that's getting me into trouble. Perhaps I've got the wrong idea entirely - is there a more AS3-appropriate method for "expanding" this to reveal the extra content?
What I'm wanting to happen is that when the "body" movie clip changes size, I want the objects within it to be scaled proportionally (keeping the x:y ratio the same). The result that I'm wanting will result in the contents (as a whole) being proportionally scaled to the height (because it will always be the smaller dimension in my case) of the current size of the body mc.
I've uploaded my .fla so you can see what im working with. The red square is the body that i've managed to scale but I have not yet added anything within it. (I have tried but it's contents distort when the body is resized)
I'm building some navigation that extends all the way from left to right across my SWF. When the window resizes, I'd like the nav buttons to get wider but not have the text on the buttons get wider.
The buttons themselves are rectangles with a vertical gradient and a stroke around the outside. I'm using 9-slice scaling so the stroke doesn't scale, but the middle (gradient) gets wider or narrower.What'd be great is to be able to select an object or layer and say "don't scale, even if the rest of this movie clip scales". Is there a way to do that, or will I have to do it via actionscript?
really sorry to bring this one up again. I've managed to create quite good working gallery. What I'm trying to now is create a menu that is attached to the scaling part but does not scale it self - in other words just changes position. here's an example of what I mean: galleru #1
What I'm trying to now is create a menu that is attached to the scaling part but does not scale it self - in other words just changes position. here's an example of what I mean: galleru #1
I have a movieclip which contains nested movieclip( i mean i contains other movieclip inside it) and the outter moviclip will scale when the stage resizes and fit in the window wich is all right but the nested movieclip should not scale ( i mean i dont want to scale the inner movie clip) how can i do that in action script 3.0.
I have a portion of a project that is similar to a MS paint program and the user can create a picture/poster, etc. When they hit the continue button, I am able to scale down the picture they created (it is in a movieclip) and store it in an array to be returned later on in the project. The only problem is that when it is returned, sometimes the textboxes that they inserted will push the last word to a new line.ex. They type = "This is my poster Yeah!"it returns = "This is my posterYeah!"I was playing with converting it to a bitmap and then displaying that, but I've never used that so I'm unsuccessful
i have read a number of tutorials on the internet trying to find a fix to the problem i am having. Everytime i create a new movieclip using public var mc:MovieClip = new MovieClip(); the movie clip is created after setting the values and drawing a square to show it in the file. However when i add an image to the movie clip i created it scales to be the same size as the movie clip or half the size of the movie clip which isnt what i want.
mc.addChild( GameTile ); // add the square instance into display list GameTile.loadBitmap("stronghold.jpg", 0, 0);
This is the code i use to add an instance of my image class to the movieclip called mc. I was wondering if anyone has a simple way of scaling the image to its original size within the new movieclip instance? I have tried various ways of scaling and it works but when the window is resized the image is not the correct size.
I have a movieclip in the library that contains a RadioButton component and a TextField; it serves as a container. I pull the clip out of the library at runtime and populate the text into the TextField. I don't know what height the TextField within the movieclip will be but I want the movieclip's height to be the same as the height of the text in the TextField so I can position it appropriately. However, the container movieclip always wants to be some other default height (I think 100px) and when I try to change it thru code after the text is set, it scales the whole thing (TextField & RadioButton) and looks like garbage! I need to set the height dynamically without the stupid scaling.
You would think the movieclip would resize based on it's content but it doesn't! I've tried pulling it from the Library, I've tried doing everything thru code, but neither changes the height vs. scaling issue.
I have a doubt regarding scaling a movieclip. I tried this method where I make a movieclip dynamically, add an image to it which I load from my desktop. The image appears fine. But when I scale the movieclip using the mc.scaleX and mc.scaleY properties the mc woudnt budge. There must be some other wat we can accomplish that. Can someone put in some thoughts on it. here's the code..
[Code].....
In the code I have not used the scaling codes since it doesnt work. And when I add the two line code, the image disappears, but the mc is on the stage which is clickable. maybe I should place my mc inside a container?
I have a movieClip in my metronome you can see here: When I resize the metronome the tiled movie clip I use for the decorative borders resizes as well and I would like it to tile more images when it is resizedI would like more tiles and I want them to be their original size.
I have a Movieclip containing five images in a row. I have seven images inside a mc next to eachother like a T (Five across and three down) with one image being the center image. The images are under a mask an then the images tween on the X and Y but obviously only the masked part of the image is visible. The mask is 1280x649 and I was wondering how to proportionally scale only the masked area to full screen. I have the following code which works perfectly on a single image inside a mc but how do I do now?
Essentially I'm building an application in Flash, just for the fun of it really. Upon the initial design it was just a static size, now however I've been working on making it completely resizeable (with the original size as the minimum). I've done this on most of the screens correctly. However on the main screen I have several components. All custom built MovieClips basically, and inside these are more MovieClips, and inside those are even more movieclips.
For my question, I'm going to be using a button as my example. I created a button movieclip with a resize function to call after I change the size of it. So it works like this: ActionScript Code: buttonMC.width = 200; buttonMC.height = 150; buttonMC.resized();
Now this button is inside of another movieclip which is designed to just house a group of similar movieclips. (this structure is not changable; several hundreds of lines are code are specifically designed around it). How to get our button's width from the root timeline, we'd do this: ActionScript Code: trace(housingMC.buttonMC.width);
Now, when this frame gets resized, the resizing script changes the width height of the housingMC. Something like this: (not a working example) ActionScript Code: //resize listener { housingMC.width += stageWidth - oldStageWidth; //width difference housingMC.width += stageHeight - oldStageHeight; //height difference And the housingMC changes to the correct size in the correct position of the screen. [Code] .....
Look at the example: Left sqaure mc1 is cachedAsBitmap right square mc2 is usual MC. Go mouse over the edge for scaling for both mc's. Cached movieclip goes crazy How I can bypass this thing easily?
I am building a flash piece in which I need an object to move across the stage from right to left and scale from 100% just off the right side of the stage, to 70% in the middle of the stage and then 100% again just off the left side of the stage. Giving the illusion that it is moving in a circular pattern around the viewer. My goal is to get the scaling to be relative to the MC's x position on the stage. Moving it across the stage is the easy part, and I can scale the MC from 100% on the right to 0% on the left using an onEnterFrame function containing:
but I can't seem to figure the 100-70-100 deal out. I thought there might be a math function like sin, cos or tan that would really help out, but I can't seem to find anything out there
My question is this: Can I add/modify to this code to make the MC scale proportionately up as I drag the browser window farther open? Right now it stays centered but it stays the same size.
So I've got problem with some drawing objects inside movieclip in my flash file... Setting width and height of flash to match browser's w&h got my movie clip to get correct values, but unfortunately drawing objects inside of it are not scaled as movieclip. Those object are just random stripes that got some tween on it acting as somekind of preloader... All graphics are pulled from ai file, so no AS was used to manipulate them, just pure tweening in design mode...So if my stage w & h are lets say 720 x 50, graphics inside movieclip are 1600 x 900 which match my monitor's resolution.
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.
In my movie I have a few products that I resize dynamically based on which one is selected. the selected product is shown full scale while the other are scaled back. However the scaled back ones lose image quality and look pixelated. the products are currently movieclips in my presentation. Is there a way to use scale w/o it distorting the image? I'm currently using TweenLite for my tweening/scaling.
I'm trying to tween a large image 6917x1500px. I'm moving the x,y and scaling this image. It's a jpeg, and the image really chuggs at certain sections. Has anyone tweened an object this large before? Should I be trying tween lite? I don't think that will work, because it just has less settings.
I'd like to simply scale down a movieclip (that I'm treating as a button) when the user presses their mouse button. When users release the mouse button, I want my button to scale back to it's normal (.scaleX = .scaleY = 1) size. My button also has listereners for a ROLL_OUT event to turn off (.alpha = 0) a highlight movieclip that rests atop movieclips showing the different states the button can be in.
When I roll over the button, the higlight comes, but there is an annoying flicker problem. For some odd reason, when I press the mouse button the ROLL_OUT event handler function is called, yet I didn't scale the movie down enough for the cursor to be off of the actual button itself. I do not want that flicker. I'm not sure why ROLL_OUT is being called even though the event is clearly a mouse down, and within the mouse down event handler I am scaling the button movie clip, but not enough to remove out from under the cursor. In other words, if I click the button at its registration point, a flicker appears.
Here's my code.
//this add all the appropriate listeners to the button private function addMouseListeners() { this.addEventListener(MouseEvent.MOUSE_OVER, mouseOver); this.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown); this.addEventListener(MouseEvent.ROLL_OUT, rollOut); this.addEventListener(MouseEvent.MOUSE_UP, mouseUp); }
[code]....
why my rollOut function is being called when the mouse button is pressed, and called once more when the mouse button is released.
I have a 50x50 fixed rectangle in the center of the stage. I am using this rectangle as a "hit area" to copy pixels of a bitmap that is draged by the user to line up an area of the image he/she would like to crop.I have preview of the hit area displayed while the bm is being dragged which works well. However, once the bitmap is scaled using the slider component the preview area no longer reflects what is in the hit area.
Code below:
function mouseDownHandler(e:MouseEvent):void { // Contraint #8 - Define drag bounds[code].....
I'm scaling onstage MovieClips via AS properties "scaleX" or "scaleY", which kills any kind of animation the clips have within their container MovieClip, be it Classic or Motion Tweens. When I don't scale the MovieClips, they animate fine. I'm able to tell the clips to "gotoAndStop" on their own internal frames, and that doesn't affect their animation within their container clip. I'm referencing the clips via AS w/ their instance names defined in the IDE. I've also tried different clips and recreated them, getting the same behavior.
Is it possible to scale a clip via AS and still have it animate within its container timeline? Does applying an AS property to an onstage instance somehow dissassociate it from other timeline properties?
I'm scaling onstage MovieClips via AS properties "scaleX" or "scaleY", which kills any kind of animation the clips have within their container MovieClip, be it Classic or Motion Tweens. When I don't scale the MovieClips, they animate fine. I'm able to tell the clips to "gotoAndStop" on their own internal frames, and that doesn't affect their animation within their container clip. I'm referencing the clips via AS w/ their instance names defined in the IDE. I've also tried different clips and recreated them, getting the same behavior.
Is it possible to scale a clip via AS and still have it animate within its container timeline?
Does applying an AS property to an onstage instance somehow dissassociate it from other timeline properties?