ActionScript 2.0 :: Get Global Scale Of A Movieclip?
Aug 3, 2010
If I wanted to get the global position of a movieclip inside another movieclip I just have to use localToGlobal. Is there anything similar I can use for _xscale and _yscale?If I have a movieclip which is scaled inside another movieclip which is scaled, how can I tell what the combination of those scales effectively become?
View 5 Replies
Similar Posts:
May 18, 2010
Let me try my best to explain this... On the stage I have a master movieclip, for explanation purposes, let's call this movieclip "body". Nested inside of body are several other movieclips (we'll call them anatomy items like: arm, hair, foot, etc) Now let's say we scaled body to 200% (body.scaleX = body.scaleY = 2.0)
When I run localToGlobal on one of the nested anatomy movieclips (e.g. arm), actionscript is returning the x and y values of the initial state, not reflecting the scale of body and how it actually caused the arm's position to shift globally.
View 0 Replies
Feb 10, 2010
I have a movie clip called "myMC". I set its x value as such:
[AS]
var myMC:MovieClip = new MovieClip();
addChild(myMC);
myMC.x = 100;
[Code]....
I know I could proboly acheive this with a math equation but is there a function that can get the exact global position of "myShape"? So that I can position another movieclip or sprite around that movieclip?
View 3 Replies
Oct 23, 2003
I have one movieclip A within another movieclip B , and I use button to move movieclip B up and down. Then how can I get the position value of the movieclip A ( the global position not the relative position to movieclip B ).
View 3 Replies
Dec 5, 2009
I have a global movieclip named globalInstance, but now I need to duplicate this movieclip and position them 5 x cordinate away from each other , how can I do it?
View 2 Replies
Jun 9, 2010
I have a global movieclip named globalInstance, but now I need to duplicate this movieclip and position them 5 x cordinate away from each other , how can I do it?public static var globalmc: DisplayObject; ( this is how I created the global mc)
View 1 Replies
Mar 27, 2009
I have a movie clip on my stage and it is named quest. Within quest, there are several frames representing the entire game (it's a text based adventure). Every once in a while, there will be an inventory item in one of those frames that has the ability to be dragged and dropped into the inventory box (which is a seperate movie clip on the main stage).
All of that works fine, however, since the movieclip that can be dragged was defined in the 'quest' movieclip, once the user needs to move on to the next frame in the quest panel, the inventory item disappears from the inventory box.
View 1 Replies
May 20, 2010
How to declare global variable for MovieClip. Normally for other datatype, i just declare:
package
{
public class MyGlobal
{
[Code]......
View 3 Replies
Mar 21, 2011
I have a movie clip of an explosion which is done in code because I am randomizing the direction and amount of debris from the explosion, so it's a movie clip with one frame, and all animation is done in code. Problem is, I'm trying to pause the game from the main timeline when the player presses "p". Right now I have it so it turns the variable gamePaused = true and calls the function pauseGame() which stops everything else. However I don't know how to access the variable gamePaused from inside the explosion movie clip's code. If I can somehow check that variable in the movie clip, I can pause that animation until the player presses "p" again.
So basically, how do I access a variable in the main timeline from a movie clip?
Also just to point out, all of these explosions were created as Sprites in the main timeline's code, any solutions I have found online didn't like that. So just keep that in mind.
Here's the main timeline code:
//This Creates An Explosion<br>
function createExplosion(explosionX, explosionY, explosionSize):void{<br>
//This Creates The Explosion Movie Clip
var explosionSprite:Sprite = new Sprite;
[Code]....
View 1 Replies
Apr 28, 2010
Is this possible AS3? I've been searching everywhere for a way to make Movieclip Instances globally accessible and haven't had any luck.I know I can make variables global by making them public and static in the class constructor, but I can't find a resource for objects.
I hear this is typically bad form, but I have a portfolio site where the entire site and it's contents change scale and position for every thumbnail.If I could make things like the BG, border, header, footer etc. globally accessible, I could change them all with a one or two global methods.
View 6 Replies
Apr 2, 2010
I have some filters set up, and have assigned some global vars to them, which I then use in my Filters code to display the filters: myText:Filters [globals.data.glow1, globals.data.stroke1, globals.data.shad1] Works perfectly. Now I want to assign a global var to each global filter var to determine if it should be shown or not. So...
[Code]...
View 7 Replies
Feb 25, 2007
Is there a simple way of determining a nested movieclip's global rotation?I have several nested movieclips that need to know what their rotation is to the main stage.
View 1 Replies
Apr 28, 2004
Is it possible to make global functions, much in the same way you make a global variable, reachable from anywhere in the project?
View 1 Replies
Apr 22, 2010
I am trying to find the code to have my mc scale from 0 to 1 in AS3 on enterFrame.Unfortunately, I have researched and have found every solution but the one I need.
View 8 Replies
Jun 20, 2009
Is there a way to set the swf to scale apart from one MovieClip? I have a bitmap pattern which i dont want to change!
View 1 Replies
Jun 20, 2009
Is there a way to set the swf to scale apart from one MovieClip? I have a bitmap pattern which i dont want to change.
View 1 Replies
Jan 28, 2010
I'm trying to build a styled, rounded button movieclip that I can reuse/resize. So inside a movieclip, I have two layers:
Layer 1: A border, which is a shape - a rounded rectangle (or actually the stroke of a rounded-rect).
Layer 2: A nested movieclip which contains a shape for the face of the button. I have added filters to this nested movieclip to give it a beveled-type look - typical rounded button stuff.
So, I've tried applying scale-9 to the parent movieclip: in this case the border scales fine, but the face (with the filters) does not. So, then I tried applying scale-9 to both the parent and the nested face movieclip,I want to be able have the button self contained as a clip which I can pull from the library, drop on the stage, and scale without distortion - and so far, as mentioned,I can't figure out how the get the nested face, the one with the filters applied, to scale appropriately.
View 1 Replies
Nov 4, 2003
I have a button in a movie that I want to set a global variable to a new value when clicked. I want it to access a parameter of a movie clip that this same button loads onto the movie for the new global variable value. I have the final line under this button's onrelease script with something like this:
globalvariable1 = movieclip.parameter;
Everything is on level 0 and I've tried prefixing everything with _root. but it didn't make a difference, the global variable still wasn't changed. I'm a newbie so don't laugh if this is a really dumb question!
BriCar77
brian_carey77@ou.edu
View 2 Replies
Aug 27, 2008
I tried to scale a MovieClip with the Tween class, using:
xsTween = new
Tween(main_mc,"scaleX",None.easeNone,1,2,2,true);
ysTween = new
[code]......
View 1 Replies
Jun 25, 2009
I want when the user click and dragg (Mouse_DOWN) the rotate button, the image will be rotatedAlso, when the user click and drag the scale button, the image will be scaled.Here is my code, but it dosen't work as I need:
btn_rotate.addEventListener(MouseEvent.MOUSE_MOVE, on_btn_rotate_down);
btn_rotate.addEventListener(MouseEvent.MOUSE_UP, on_btn_rotate_up);
function on_btn_rotate_down(e:MouseEvent):void
[code].....
View 2 Replies
May 5, 2011
I'm trying to change the y-scale or x-scale of a movieclip. I've tried a few tutorials but they're always talking about "elem._yscale".. However it's no longer supported by AS5.
View 2 Replies
Jun 26, 2009
I have 2 movieclips (btn_rotate, btn_scale) that are attached to a movieclip (view_mc) that holds an image.
These 2 movieclips are used to rotate and scale the Other movieclip as in the attached picture
I want when the user click and dragg the btn_rotate, btn_scale, the view_mc will be rotated and scaled respectively, in smooth way.
But I can't achieve that.
Here is my code which is wrong:
ActionScript Code:
btn_rotate.addEventListener(MouseEvent.MOUSE_DOWN, on_btn_rotate_down);
btn_rotate.addEventListener(MouseEvent.MOUSE_UP, on_btn_rotate_up);
function on_btn_rotate_down(e:MouseEvent):void
[Code].....
View 1 Replies
Mar 30, 2011
I have created a 3D product view page with a scrub bar that spins the object via 32 images taken of the object all the way around.
I would now like to add a zoom and pan function of some kind as well. Anyone have any suggestions or FLA files with this sort of thing? The 3D spin images are inside a movieclip, so I basically need a "+" and "-" button to scale the images up, and then be able to drag the movieclip around the stage too.
View 3 Replies
Aug 24, 2011
This is a test I'm doing, where I have movieclips inside my movieclip holder that scale up as I hover over and scale down when I'm no longer hovering. Here is the code for that:
ActionScript Code:
import flash.events.MouseEvent;
import flash.display.MovieClip;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.events.Event;
[Code] .....
This works great. The only problem I'm having is that if you hover over each of the items quick enough, they don't scale back down.
View 3 Replies
Jan 18, 2010
I have x amount of MCs arranged vertically with the distance between each being the same. When I roll over any of them the X & Y scale increases for that particular MC with a tween and on roll out they decrease to the MC's original size. Here comes the sticky bit...how can I maintain the distance between each when the scale of an individual MC is increased/decreased? I have attached a basic swf to show you what I mean. (Only the middle MC is active).
View 6 Replies
Sep 12, 2008
I'm looking for a solution to scale (gradually scaling) the movieclip on mouseover and return to previous state on mouseout. Any movieclip prototypes available for that
View 2 Replies
Nov 7, 2008
I have a movie clip which I want to scale up on a key press and then when the key press is not pressed I want it to scale back down. simple right? but I cant do it? Once I have that sorted out I would like to take it one stage further by making this work: If a key is pressed and let go the movie clip scale up and then finishes. if the key is pressed and held then the movie clip scales up slowly but once the key is released the clip reverse back to frame one.
The file can be found here : [URL]
View 2 Replies
Jan 18, 2004
I am using the folowing as on a movie clip to scale it:
[AS]onClipEvent(load){
targe_width = _width;
targe_height = _height;
}onClipEvent(enterFrame){
_width = _width += (targe_width - _width)/3.6
_height = _height += (targe_height - _height)/3.6
}[/AS]
This as works fine but I have 30 clips that I want to apply it too. How can I turn this into a function i.e
[AS]function scale(targe_width, targe_height);
[/AS]
So on each clip I can invoke the function by calling something like
[AS] scale(50, 50); [/AS]
View 1 Replies
Apr 14, 2009
I'm using transform.matrix3D and transform.perspectiveProjection.get the scale effect, or z factor of a MovieClip?
var distanceRatio:Number = viewerDistance / (viewerDistance + z);
View 5 Replies
May 11, 2010
My_mc is a MovieClip. I want to scale My_mc on click event.
View 8 Replies