ActionScript 1/2 :: Drag An Object And Scale Smaller As It Goes Up The Screen?
Feb 8, 2011
I drew a farm and I want to be able to move the animals around, also to make it a bit more real, they need to scale down proportionally along the y axis, I have been searching for a tutorial or download to no avail.
I have had some help but still not understanding this.
How can I scale an object from center after it is dragged by the user?
Currently I have this: function onSliderChange(e:SliderEvent):void { scaleClip(slider.value); }
[Code]...
With this code the movieclip jumps back to the center of the stage each time I call the scaleClip() (move the slider). I would like the object to scale from it's own center regardless of where it is on the stage.
I am learning AS3 and trying to get an object to be able to move / rotate / scale and drag and drop. I found 2 seperate tutorials one does button clicks to move and rotate code.[code]When I add the second lot of code to the first app (ie add a layer and insert the script ) change myPoint to rocket . I get the following errors:'{' expected
For lack of a better description, I have a world of bitmaps, but some are outside the boundaries of the stage. How can I scale my world larger and smaller to effective zoom in and out?
I'm creating a simple navigation for a portfolio site. On my main (root stage) I have one movie clip. Inside this movie clip I have all the elements of my website. I'm doing this so the user can scale and move the navigational elements around. This is accomplished by simply placing actionscript on frame 1 on the main (root stage).
Code: nav._xscale = 60; nav._yxcale = 60;
Eventually I will but a slider on the main stage so the user can scale to whatever size. My problem is that everything scales fine, however, the hitboxes become extremely small, and don't scale with the rest of the elements.
I'm trying to create a game and I'm new to actionscript. I'm using actionscript 3.0 and flash player 9. I'm trying to have a button that when clicked creates an object that follows the mouse around the screen until that object is placed on the screen. When I click the button the object follows the mouse but it ends up covering the screen with the objects drag.
I'm trying to make a movieclip scale proportionally only if the item is being resize smaller than the current.Obviously I can use the ScaleX/Y values like so:
I am very new to AS3 and I am running into some issues creating a simple class that will allow you to drag and drop and object but then also scale when it is over a hit area. Here is my current code:
[ X ] Problem solved I just came up with something i have some trouble to handle I've tried a couple of solution but none seems to work perfectly
What I'm trying to do is simple, get my flash to go full screen, but whatever resolution the user has, my flash must centers itself with the biggest proportion possible, and two movie clips goes right and left of it, as if they were borders.
I've been able to do this with a simple png, but i was not able with a movieclip where his dimension changes through time. ( i have a tween, so the mc gets really big even though just my stage is displayed)
I found this really neat photo gallery on flashkit but there is no support or readme included. how to size this thing.. the AS code does have comments but I am not a coder.I'd like to make the image window smaller and the overall movie smaller. 325x325 or so
Basically, there will be two images, which participants are to choose between. Below the pairs of images will be a horizontal bar with arrows at both opposite ends. I would like the participant to be able to drag and drop a small rectangle somewhere along the bar to represent their choice (and the degree of their endorsement).Basically, I'm asking how to make an interactive scrollbar on its side (without buttons, just the drag). I would also like it to start in the middle of the bar and be able to be moved in either direction.
I have an image inside a movie clip that a user can scale from its center using the slider....works great.However the use can also drag the movie clip.After the movie clip is dragged to a new location it and then scaled using the slider it jumps back to the center of the stage and then scales.I have tried modifying the x y of the movie clip but then the scale is no longer from the movie clip's center.
var clipNativeX = holder_mc.x; var clipNativeY = holder_mc.y; function scaleClip(val:int):void[code]......
I have finished my Flash presentation which is set for a large monitor. My file is 1920x1080. How can I get the SWF to scale to a smaller monitor if needed? When I output an HTML file, (set at 100%) the file scales, but the rollover buttons only work on (Click) and the cursor doesn't change from the arrow to a hand. Is there a code that I can place within the action window?
Background: Sorry for the complex title, but can't think of a better way to describe this. So I have an image which is constantly moving and rotating (using matrix rotation around a specific point) on the stage. Problem: So I'm looking for a way that, when the user presses a button, a smaller image (exactly the same as the original one, only 3 times smaller) to position itself so that the smaller image's location is proportional to the the larger one's location. This means that the exact point of the larger image where it is rotating should be the corresponding part of the smaller image, thereby causing a kind of zoom out effect.
The truth is, I'm finding it even difficult to match just the x and y positions so they correspond, ignoring rotation, assuming the position is relative to the rotation point. Even this would be useful.
I'm trying to create this drag and drop sequence where the "temperature_small" movie clip is dragged and dropped onto a spot on the stage. I've got the drag and drop part of the ActionScript ready, but the trouble comes when I want to re-size the movieclip to make it smaller, I keep getting the error code:
I have been playing with this code for a couple of days and I am getting "decent" results but not consistent. Basically I want to get the users resolution and divide it by the optimum resolution and scale the page. What I am trying to attempt is that items stay the same size regardless of resolution. I realize that I will get some distortion but when testing the distortion doesn't seem to effect the overall look of the page. If I stay away from really small fonts I seem ok. Regardless you get some distortion in lower resolution anyways.
Here is the code. var userResX:Number = System.capabilities.screenResolutionX; var noXScaleRes:Number = 1440; var swfXSize:Number = 1000;//stage width var thisXRes:Number = ((userResX / noXScaleRes) * 100); var xCntr:Number = (swfXSize / 2) - (((thisXRes * swfXSize) / 100) / 2); [Code] .....
Now when I test on resolutions with similar aspect ratios 1.7 as the optimum resolution the content scales to respectable "result". But when the aspect ratio is closer to 1 to 1 I don't it squares my content. Since I am handling the x and y separate I am not sure why it would?
I'm developing a Flex application that is designed for screen resolutions of 1280x1024 and more. In the rare case that a projector is used (which usually has a maximum of 1024x768 pixels) I'd like to scale down the application (currently I get lots of scrollbars and clipping).
I've already experimented with the application's properties scaleX and scaleY as well as stage.scaleMode. However, I couldn't quite figure out a way to
render the application without scaling when the application's width and height are larger than certain values use scaling when the width or height are smaller than certain values
I am still struggling with transforming my app build in Java/Eclipse to Flex/Actionscript with Flashbuilder.Now I can not find how I should implement an image to cover the hole screen.[code]...
I have a Flash movie that runs full screen, but with StageScaleMode.NO_SCALE so that the actual movie size is the same as it would be if I ran it not full screen.
There is a huge difference in performance between full screen and no full screen. This is despite the movie taking up the same screen space.
I have this code to scale external images to full-screen:
function resize_image(){ pic = big_mc.swfloader; Stage.align = "TL";
[Code].....
It works fine but I want to change it so the scaling is determined by the browser height, at the moment it scales to the browser width so you lose some of the image height - Also, need to keep the images in proportion
Would anybody happen to know if there is a way to scale objects accordingly on stage when switching to fullscreen.. It's sort of like when the stage is set to "scale", and all the objects scale accordingly, but I'm trying to scale the objects while having the stage set to "noScale"..
I'm building a flash website that needs to have fullscreen enabled for the entire site. Does anyone know how to make only specific movieclips scale up in size when entering full screen mode, like various background movieclips?
I have been looking on google and couldn't find a answer. I have a application I created in adobe flex and I need it to scale to the users screen and fill the entire browser window no matter what.