ActionScript 2.0 :: Dynamically Scaling An Object?
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
Similar Posts:
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
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 27, 2009
It also need to have some random scaling to it, maybe something like this code below.
Code:
targXscale = 50;
targYscale = 200;
[code]....
View 1 Replies
Dec 12, 2011
I have a rectangle drawn on the screen. I exported the center of the rectangle for action script. I have an instance of the center exported rectangle overlaying my main rectangle. I do this so that I can change the back color with actionscript. I have the blending property of the overlaying rectangle set to overlay so that borders of my original rectangle are visible.
My problem is when I scale the flash window the borders of my rectangle sometimes dissappear.
View 6 Replies
May 16, 2009
If you click the "FS" button inside the player for full screen, it goes to full screen, but does not scale my player. Here's my SWF embed code. I have tried it both this way and taking out the wmode line.
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject("player_bitgravity_fs.swf", "flvplayer", "724", "409", "9", "black");
so.addParam("wmode", "transparent");
[code]....
View 1 Replies
Apr 15, 2012
I have basic shapes created using flex primitives classes like ellipse rectangle etc. Each of these are added into a graphic object.Now i am in search of a mechanism to select it and scale it (as in Photoshop Transform -dragable corners and edges, image gets scaled on dragging)
View 1 Replies
Nov 4, 2009
I want to animate a person moving off into the distance, but while I want the size of the figure to get smaller, I don't want the weight of the lines that comprise the image to scale down, too. I made this little sample of a person skating (poorly) away from the viewer, and I'd like the line weight to be 9 points in the first frame and the last frame. Is there a setting that allows me to exclude stroke weight when scaling and resizing an object?
View 1 Replies
Jan 27, 2009
I'm working on a Flash application that has thumbnails and fullsize versions of an image. The steps I'm taking:
- import the image at runtime, and attach to a movieclip (we'll call it polaroid, since that's what I'm calling it).
- resize polaroid via polaroid._width=3; polarois._height=3; to get my thumb
The image quality is OK for pictures, but it's also fairly important that text not look too pixelated. Is there anything relatively simple (i.e. not too taxing on RAM) I can do here? Even a blurring layer would do the job, if there is any such thing.
View 8 Replies
Mar 30, 2005
Vector Scaling Object Without Affecting the Original Point
View 1 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
Jan 24, 2011
I'm trying to dynamically addChild a Sprite to an already tweened MovieClip (tweened on the Flash timeline).
Let's say ObjectA is the tweened object, I published it in my swc and linked it to my Actionscript project in Flash Builder. I make an instance of ObjectA in my class, and then try to do the following:
var objectA:ObjectA = new ObjectA();
var objectB:ObjectB = new ObjectB();
objectA.addChild(objectB);
addChild(objectA);
Now, the problem is, objectB doesn't tween along with objectA. Is there any logical solution to this?
View 1 Replies
Jul 1, 2011
How to dynamically add attributes to an object and convert that object into xml in Flex/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
Jun 17, 2009
I have a swf file that loads into my main movie, and within that swf there is a masked image that i would like to scale using zoom in and out buttons and also by using a slider bar.However i cant find any tutorials that will allow me to combine the two.I have used the following code for the buttons. Which seems to work ok but i would like it to be a little smoother. (using speed or some sort of easing??)
ActionScript Code:
zoomPlus.onRelease = function(zoomIn) {
if (test_shirt.shirt._xscale == 400 && test_shirt.shirt._yscale == 400) {[code]....
but for this code it keeps shrinking my initial object down to 10 pixels by 10 pixels..
View 0 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
May 15, 2009
I really don't know much about flash or swf files but in updating my portfolio I came across Polaroid gallery. I have managed to update the background jpeg with my own picture and remove the fade effect. However in the original program the background was tileable so when seen in a full screen browser looked fine. As my picture is not tileable I would like to know if it is possible to scale the background or the whole swf object without tiling the background.
View 1 Replies
Jan 4, 2010
On library i have mc. In property i made Export for ActionScript. And on timeline add code:
var my_pic_mc:Pic=new Pic();
addChild.(my_pic_mc);
but dont see my movie clip on the stage after compile.
View 5 Replies
Nov 18, 2011
Dynamically set property of Object in it? How can I do this.[code]...
View 1 Replies
Feb 11, 2012
So, if I need to give a custom variable name to an object how would I do that?
For instance, if I have a gameID that is 12345 and its rating is 3 I want to save a variable called gameRatings_12345 thats value is 3 in my shared local object.
//share object
protected var mySavedData:SharedObject = SharedObject.getLocal("mySavedData");
I have the game id in a string
var gameID:String = "12345";
Then when I try to assign the value like this...
mySavedData.data.gameRatings_gameID = 3
I think it's literally reading it as "mySavedData.data.gameRatings_gameID" instead of "mySavedData.data.gameRatings_12345"
How can I give the variable a custom name?
View 2 Replies
Dec 14, 2007
I have 3 objects: obj1, obj2 and obj3.[code]...
View 1 Replies
Dec 9, 2009
I have an object that changes sizes dynamically but I want to keep it centred, I recall seeing a piece of code somewhere but I can't seem to locate it now, basically what the code did was use some getBound or math function to figure out how wide the object was, how tall it was and the figure out where the centre would be and then center it... i have a function an onstage resize function but i need to know how to keep this object in the middle of the stage.
View 0 Replies
Jun 27, 2010
Anyone know how to access a var name dynamically with an object? I need to be able to get myObject.objValue1. But I want to go through a whole bunch of them in a for loop from value 1 to 50.
View 1 Replies
Sep 15, 2007
I wrote some code for the thing I was working on, yet the problem is that when you grab the wheel and spin it again, I want it to stay in the same position and rotate instead of reseting.
(The holes are markers)
I don't mind if you just want to upload it. But if you do, follow my method (I don't know, say for example using masks or something), and just add new variables if needed.
View 2 Replies
May 7, 2011
Essentially what the project consists of is I have random balls appearing on the screen and moving around and I need to make it so that the user is able to draw a circle around the ball (may be more than one) and have that balls dissapear and count the number of balls circled.This project is being done in flash builder 4.5 and is being made for the android platform as part of a senior project.I have been able to randomly create the balls and give them a random movement. I have also been able to figure out how to allow the user to draw on the screen.
What I am trying to figure out is how to make it so that if the user draws a circle around the balls make it so that I know these balls have been circled and make them dissapear and have the number of balls inside the area calculated.I have thought about making the entire background a grid and make it so that I can track somehow the line made by the user and then track the coordinate of the balls then if it is within that area it means that the ball has been circled but I would like something more efficient than that.
View 1 Replies