Actionscript 3.0 :: Scaling A Box Dynamically?
Jun 2, 2009
I am trying to scale a box with handles.
It looks like this:
I am trying to create a function but I have to admit to myself I don't really know how to do this Here is the code with some things I have been trying. I do get it to scale. But the rectangle moves.
Code: Select allif(scaling)
{
var scaleDistX = scaleMouseStartPosX - mouseX;
var scaleDistY = scaleMouseStartPosY - mouseY;
[Code].....
View 1 Replies
Similar Posts:
Dec 22, 2004
I managed to scale a movie clip's width with easing. With this code:
onClipEvent (enterFrame) {
endWidth = 50;
_width += (endWidth-_width)/speed;
}
But it scales both from left and right sides i just want the left to be stable and right to scale.Shortly A box which width is 200 will become 50 but the scale will be from the right.
View 11 Replies
Apr 24, 2009
I need to scale a movieclip to fit the width of the screen and it's height to stay proportional. I have code that's always worked fine but, in this case, the movieclip is constantly changing size and this throws off my code, scaling it incorrectly when using a listener (it's initial scale is perfect).
Code: Select allgreybar._width = Stage.width;
greybar._height = Stage.height;
greybar._xscale = greybar._yscale = Math.max(greybar._xscale, greybar._yscale);
I imagine it's because it has shifted from the size it's proportions were read from by the time it applies them. I know my problem is theoretically solvable because the movieclip can be scaled correctly if I scale width and height equally. However, I need the movieclip to always be the width of the screen.
View 4 Replies
Feb 9, 2009
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.
View 1 Replies
Apr 9, 2009
Im building a site for a photographer, all images are xml driven.. When a thumb is clicked the full size image is loaded into an empty movie clip.
I am after a similar effect as seen here..[URL] If you resize the window the image resizes to scale...
I have managed to align the rest of the movieCLips to the stage when it is resized in its right positions just can't get the image to resize!.
View 3 Replies
Mar 11, 2008
I've search through all the threads with "scaling" and "resizing" and can't find the solution.
Basically I have a GUI element on a gallery that I don't want to scale, while the rest of the page is free to resize/scale.
I think I need to add a listener of some sort to the stage, but I'm not sure how to do this.
View 2 Replies
Feb 23, 2009
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?
View 1 Replies
May 20, 2010
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))
[code]....
View 4 Replies
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?
View 2 Replies
Apr 18, 2004
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
View 14 Replies
Apr 18, 2004
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
View 13 Replies
Oct 27, 2011
I have a game where i add some cartoonish ants, that when they are clicked, they need to be removed from stage. There are 4 differend kinds of ants, so im doing a Math.random for picking which one to add. (ant 1+2+3 have 50% chance to spawn and 4th 50%)
Code:
rnd_nbr = (Math.random() * 5)+1;
I have a timer doing 10 tick, and i reset the timer to make neverending. Then i have a math random and if sentences adding mc' to the stage with movement from Tweener, and event listeners for clicks. But i cant figure out how to remove them when clicked. I have done alot of failed tries right inside the click_candy_anty function. I've left them commented out.
Code:
import caurina.transitions.Tweener;
var ant_index:Array = new Array(10);//index for ants
var ant_number:int;
[Code].....
View 4 Replies
May 18, 2009
Essentially, I've got a MC container that's created dynamically based off an XML file (basically for every <title></title> I've got, it makes a new "card"). Now within the context of each <title></title> grouping I've got <imgs></imgs> in which I specify the path to images that are related.All of that works perfectly, save for the external jpg files actually appearing on the stage. The MC I add them to does, but the external image doesn't.My problem is- I can't add the external images until they're completely loaded (or so it appears). The thumbnail BG I use is blank. So I know for a fact that the thumbnail BG isn't occluding the loaded thumbnails.
View 2 Replies
Apr 2, 2010
[Code]...
That's the correct syntax for this? I want to be able to dynamically write to several textfields that exist on the stage but have not been dynamically placed there.
View 3 Replies
Nov 24, 2010
i want to show swf with zoom out 50% by default when user opens the page.URL...
View 3 Replies
Apr 20, 2010
I want to know what is going on with my flash document where more of the document is showing than the document size. despite the little white box showing the size, if i set scaling to 100% it starts reaching past the boundaries. how can I get my flash doc to scale without viewing what is essentially outside of the frame?I am experimenting with getting my flash website to scale. I have tried a few things like SCALE="default" in the html and such. I want to try and keep the aspect and scale, but have a minimum size. For this I have been trying swffit.
View 2 Replies
Aug 23, 2010
I am making a site using a liquid layout in Flash and have added an FLV with playback component swf. When I test the file it scales fine in the browser until you try rescale/minimise/enlarge etc. It then squashes.Url...Try rescaling the browser and you'll see the issue occuring. This only happens with the FLV playback component added. It is a linked file by the by and not embedded.
View 1 Replies
Oct 5, 2011
I needed to convert a simple graphic symbol into a movie because I wanted to give it depth using the (gradient bevel) filter effect. The movie has to appear at different sizes in my animation but the filter effect does not scale with the symbol. Is there a way to make this filter effect (gradient bevel) scale when I scale the symbol it is applied to?
View 2 Replies
Sep 17, 2009
I have a flash file that I am scaling. There are buttons in the file that have tooltips that pop up when you roll over them.Problem is, the tooltips scale with the .swf file so they get huge and are not in the right spot over the button anymore.the tooltips will maintain a size without being scaled?
View 9 Replies
Dec 7, 2009
I have a SWF file, with it's own buttons and events etc. that I am trying to load into a scrollpane in a parent application, and have it be scale-able (i.e. zoom in and out).It doesn't need to animate zoom, click to new scale is ok for now.[code]Everything seems to work except the scale statements at the end, they generate a compiler error:TypeError: Error #1009: Cannot access a property or method of a null object reference.at InspectorShell()
View 1 Replies
Mar 1, 2010
I'm looking to have a logo stay locked in position on the right and the menu bar stay locked in position on the left when scaled in a web browser. The background in the main stage area. Is there a way to do this in Flash or is this done with HTML?
View 2 Replies
Nov 28, 2011
I have developed the entire module with 800x600 Resolution.But Now I got an issue that i need to reduce the content area (Shrink the contents instead of changing the resolution). Because some one had developed the custom player that will affect some of the margins of the content.Is there any AS2 script is avail for scaling the entire stage to 80 % of its original size for the entire module...
View 2 Replies
Jun 21, 2009
My preloader_mc has a layer with a movie clip called preloaderFill_mc. The I don't know why my preloader isn't scaling. The function is at the bottom.
Code:
import fl.transitions.Tween;
import fl.transitions.TweenEvent;
import fl.transitions.easing.*;
stop();
var imgLoader:Loader = new Loader;
[Code] .....
View 0 Replies
Sep 21, 2009
I have created an SWF with a 1000 x 700 pixel stage. My questions is this; what code can I use (or publish settings can I set in CS4) so that the SWF scales up or down and always fills the browser window? In other words, if I'm running my browser in full screen mode with a 1680 x 1050 widescreen display, I want the SWF to scale up to fit that monitor.Likewise, if I'm running an 800 x 600 display, I'd like it to scale down to fit that monitor as well. What I DO NOT want is for the SWF to open in a child window (as it does when I test the movie).
View 2 Replies
Nov 2, 2009
I have a class (Control.as) in which I load a external swf with loader. In my document class, I am initiating Control class and added it to the stage.I want to now scale my external swf with min and max values.
View 3 Replies
Feb 7, 2010
How can I scale up an entire animation when the mouse moves over it? Background: I'm no newbie on web development (I do PHP, javascript, CSS et al, and get paid handsomely for it) but I've never done Flash. However I am updating this site [URL] (the guy in charge is a friend) and you can see the Flash radar thingy in the corner. That came from the original site and is very old, links to the wrong pages and has the wrong text anyway. I have compensated for its wrong URLs with redirects but the owner asked if I could update it.
Well, I have a new version in CS4 Flash (having spent several hours seeing if I could modify the original it became clear that a re-write was more sensible), and everything is fine - but the only thing I can't work out is how to scale up the whole image (and scale it back down when the user moves off it). The original code was this, which doesn't scale down even though the code looks like the original author meant it to:
[Code]....
View 4 Replies
Feb 16, 2003
I'm interested in distorting movie clips at runtime based on user input. I know how to rotate - thats easy : clip._rotation is a number from 0 to 360. I know how to scale - thats easy too : clip._xscale and clip._yscale are conveniently independent. But how do you SKEW a movie clip at runtime??The best I can come up with is really complicated. If you put a symbol within a symbol and name both ( something like shell and core ), you can squish and rotate them independently, making it possible to distort the clip twice as many ways.
shell.core._yscale = 160;
shell.core._xscale = 100;
shell.core._rotation = 45;
[code].....
View 3 Replies
Oct 2, 2007
I want to add a child to a movieclip that I am scaling. However, I would like to prevent that child from scaling when the parent scales.
View 7 Replies
Oct 4, 2007
why my mc_loadingbar isn't scaling?
Code:
function load_pic(myLoad, myNum:Number)
{
var Loaded = myLoad.getBytesLoaded();
[Code]....
View 7 Replies
Sep 24, 2009
I have an interesting issue, I am trying to load 12 images into their own "Loader" with Scale content set to "true" so they scale down a bit. If I run this in Flash it works great, the 12 images show up fine inside the loader. If I then load it to a website and view it with FF it works fine, however, if i load up IE one or two of them will be fine but the others will be huge, basically not scaling to fit. By Loader, I mean the component loader. I'm sure I'm not the first person to have this issue, my first thought was they are not loading 100% before Flash is trying to scale the content? If that's the issue, how do I preload them?
View 2 Replies