ActionScript 2.0 :: Scaling Relative To Mouse Position?

Feb 20, 2004

I have a dragable movie clip that on release I want to scale, depending on the mouse position, the further the mouse up the screen (y) then the smaller the clip scales on release.

View 6 Replies


Similar Posts:


ActionScript 3.0 :: Get Mouse Position Relative To Screen?

Feb 13, 2010

I would like to know if there is any way that when mouse leaves screen, the mouse coord from the Main Movie Clip (mouseX and mouseY) keeps updating! Is there any way to get the mouse pos relative to the screen pos?For example when mouse leaves screen and goes 30 pixels up, its position would be (X,-30)

View 1 Replies

ActionScript 2.0 :: Relative Mouse Position With Easing

Jul 20, 2004

Here is my cool code....

Code:
onClipEvent(enterFrame)
{
_x -= (-20) - ((0.1 * _xmouse) - 60);

[Code]....

How can I make the easing start fast then go slow? Right now it starts slow and speeds up. Well not really, because it speeds up and then slows down once it gets closer to the mouse position. But becuase the mouse position is greater than that of the movement, it seems like it speeds up then just stops!

Here is the effect I am after....

look at the images inside of [URL]

View 7 Replies

ActionScript 2.0 :: Panning Object Relative To Mouse Position?

Jan 28, 2010

I have an flash file which is 740px wide and a movie object inside it which is 1100px wide. What I want to happen is for the movie to scroll left or right depending on the mouse position and to stop when it reaches the start or end of the movie object. It all works fine except when it gets to either end, the _x position is outside the boundaries I have set in the if statement so it wont scroll back again.Code is below:

ActionScript Code:
onClipEvent (load)
{

[code]....

View 2 Replies

ActionScript 2.0 :: Motion Path Relative To Mouse Position

Nov 10, 2007

im using MX 2004 although i do have Flash 9 atm if anyone has an example in that
Anyway, im trying to slow down and speed up an orbit of an mc relative to where the mouse position is. So basically i need some sort of radial "field" where when the mouse gets close to the outside of the orbit the movie clip stops and when it is farther away the movie clip speeds up.

[Code]...

View 1 Replies

Actionscript 3 :: Tween Position Relative To Current Position?

Jan 23, 2010

I have a tween set on a timer:

var manTimer:Timer = new Timer(1000,14);
manTimer.addEventListener(TimerEvent.TIMER, moveMan);
function moveMan(e:TimerEvent):void {[code]....

I just need to make the tween's position relative to it's current position, as opposed to starting at the stage's 0 position then moving the the stage's -40 position. It needs to start at its current position the move -40 from that position.

View 1 Replies

IDE :: Proportional Scaling MovieClips Relative To Stage?

Jan 30, 2009

how to proportionally scale multiple movieClips relative to the stage size.

I understand movieclip placement relative to the stage, and I have been using a code to scale MovieClips as a fullscreen background (also proportionally)

But

I can not figure out for the life of me how to scale other movieclips in relation
to the stage size.

for example I have a background_mc that proportionally scales with the stage
to fill without distortion.

HOW do I then place another MC say center aligned (I know how to do that) that will scale with the background without distortion?

Ideally I would like to place several MC's on my stage all scaling in proportion with the stage yet independently.

I have not been able to find any documentation on this. lots of tutorials on backgrounds and color fills and the like but nothing on proportional scaling of independent mc's

this is the code I use for my background_mc (can it be modified or should it be thrown out the window to achieve independent scaling?)

Code:

import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;

[Code]....

View 7 Replies

ActionScript 3.0 :: Proportional Scaling MovieClips Relative To Stage

Jan 30, 2009

I need some assistance on how to proportionally scale multiple movieClips relative to the stage size. I understand movieclip placement relative to the stage, and I have been using a code to scale MovieClips as a fullscreen background (also proportionally) But I can not figure out for the life of me how to scale other movieclips in relation to the stage size. for example I have a background_mc that proportionally scales with the stage to fill without distortion.

HOW do I then place another MC say center aligned (I know how to do that) that will scale with the background without distortion? Ideally I would like to place several MC's on my stage all scaling in proportion with the stage yet independently. I have not been able to find any documentation on this. lots of tutorials on backgrounds and color fills and the like but nothing on proportional scaling of independent mc's this is the code I use for my background_mc (can it be modified or should it be thrown out the window to achieve independent scaling?)

[Code]....

View 2 Replies

ActionScript 3.0 :: Scaling Bunch Of Point Objects Relative To Center Stage

Jan 8, 2012

All though I can scale down the size of my objects and can shift them to their correct positions when scaling. I cannot shift them to the correct relative positions, relative to the screen centre.

Code:
level=1; //starting scale level
public function scaleOut(level:int) // scale to a level 1-4{
for (var r = 0; r < Main.ballArray.length; ++r){
// scale radius
Main.ballArray[r].bRadius *= (oldLevel / level);
[Code] .....

View 8 Replies

ActionScript 3.0 :: Get Position Relative To Stage?

Oct 27, 2009

I have a movieclip thats inside another movieclip..lets call them mc1 and mc2..

the problem is that I want to get the position of mc2 relative to the stage...and not to mc1..is there any simple way to do this?

View 1 Replies

ActionScript 3.0 :: Distinguishing Relative Z Position?

Dec 10, 2009

Imagine that I make a movie clip that looks like a chess board, and that inside that move board I place other movie clips that look like pieces.Now imagine that I tilt the chessboard so that you are no longer looking at it top down and rotate it so that the dark pieces are first in front of you and and this slowly changes until the white ones are, etc.In order to make this look right I have to rearrange the stacking order of the movie clips (which pieces are "on top" of which other pieces when they are drawn). But when the clip rotates, the mc.z value for all the clips does not change. Neither does the width or height which I thought I could use instead even though they are clearly looking bigger or smaller onscreen.I think that I might just be getting the z point relative to the other children of the rotating movieclip. Is there any way to get the z point relative to the stage?

View 3 Replies

ActionScript 3.0 :: Position Array Relative To Stage?

Aug 10, 2011

way to position an array containing movie clips relative to the stage? Here's what I was trying...

import flash.display.MovieClip;
var one:MovieClip = new One();
addChild(one);

[code].....

View 5 Replies

ActionScript 3.0 :: Moving Image Relative To Position?

Jan 6, 2010

I had coded a different file similar to this and had a movieclip move along the x axis relative to where the mouse position is.

The idea is the movie clip is a panoramic photograph (eg. 6000x900) and it would move dependant on where the mouse it. ie. if mouse is in the centre it will be stationary and when it moves left and right the image will move accordingly (faster when further away from the centre).

The code below works moving the movieclip's x position but when I try and do it with TweenLite (using the quotations for relative positioning) the movieclip snaps immediately to -107374182.4

ActionScript Code:
import com.greensock.easing.*
import com.greensock.*

[Code]....

There is obviously something fundamental I am missing but cant see it at the minute. I had this working previously but then tried to progress it and write my own class for the panning (that now turns out I do not have time for) but I saved over the code and cant not go back.

I have put together an example zip with a .fla and the greensock tweening platform.

View 2 Replies

ActionScript 2.0 :: Browser Scroll Bar Position Relative To .swf?

Jan 6, 2011

To make this more clear I have a flash website coming near to the end of the design stage. I have a multi-layered scene with a resolution of about 700x1200 (so you would scroll down the page with the browser scroll bar). Basicly I want these layers to correspond to your scrollbar position as though the perspective changes. ie: scrolling down would push the fore ground at the normal rate but only pushing the background at a slower rate, (thus giving a 3D effect).I would imagine since the .swf would then need to talk to the scroll bar, there would be a need for another language as well as action script.

View 0 Replies

ActionScript 2.0 :: Sliding MC Position Relative To Contents?

Feb 29, 2008

I have a movie clip that I have given the a "sliding" variable to move it across the X axis. So far I have been using a variable of

Code:
movieClip.newX = -250;

but what i need to do is have the movieclip slide to a position which is relative to an object inside of it.

As i need the slider to move to a position that centers the object which the slider contains on centered on the screen - i have tried:

Code:
movieClip.newX = movieClip.ContentsObject.Stage.width/2;

but with no response. I realise that code is incorrect, but need something that will work in that way. I presume i need some sort of listener to follow the _x position of the specific movie clip.

View 7 Replies

Professional :: How To Set MovieClip Position Relative To Stage With Classes

Mar 1, 2011

I'm developing my first flash app. I'm trying to use classes because they'll be very important in my future app. I created a simple movieclip with a star. However, instead of putting it directly on the stage, I'm calling it from library, using the addChild method to place the star in the stage. To do that, I simple right click over the movieclip icon->properties->check export to action script->and I give a name to the class (for example: myMC)

Then, inside the class I wrote:
package {
import flash.display.*;
import flash.events.*;
public class myMC extends MovieClip {
var star:myMC=new myMC();
public function myMC() {
[Code] .....

As I am placing the two variables origin_x and origin_y inside the constructor, I'm expecting to get 250 and 200 respectively. After drop the star, I want to send it to it's original place, and that's why I need to keep this values. And here's the problem, origin_x and origin_y are both ZERO, instead of 250 and 200... The value is not relative to stage. I managed a little bit and I found this post : [URL]. Unfortunately I tried to replace by the suggested code, but both values remain zero. An interesting thing, is that if I put the star directly in the stage instead of calling it from the library as I am doing, I get correct values in origin_x and origin_y.

View 1 Replies

ActionScript 3.0 :: Position MovieClip Relative To Stage From Within Classes

Aug 5, 2011

I have a Flash file for an xml driven menu. There is the document Class, called Main. There is also a Navigation class. In the Navigation class, I position the location of main buttons and sub menu buttons for the menu. I want to position the buttons in the Navigation class relative to the stage. Currently, they are just fixed at certain positions (like 20); To do this, I have read that because this is not happening in the document class.

I must add an event listener to the constructor that listens for the added to stage event. I am not sure how to do this, as when I try and add an event listener for added to stage in the Navigation class nothing happens, (or all menu items diaspear). How to position movie clips relative to the stage (i.e. stage.stageWidth - 50) from a class that is not document class? How to do so in the document class, too.

View 2 Replies

Flash :: Find Position Of An Object Relative To Stage?

May 17, 2011

If I have a rectangle on the stage, how do I find its top left tip (x,y) and the bottom right tip (x,y) in relation to the stage?

View 2 Replies

AS3 :: Flash - Relative Points - Translate The X / Y Position Of The Crosshair?

Aug 21, 2011

So I have a Crosshair on the Stage and I have an Enemy with nested child limbs, when the below function is called I want to create a hit mark and attach it as a child to the Enemies Limb but how do I translate the X/Y position of the Crosshair to the Enemies Limb bearing in mind the Limb may also be rotated?

[Code]...

View 1 Replies

ActionScript 3.0 :: Text Position Relative To Browser Resize?

Dec 13, 2009

I am having problems changing text x,y position in a browser window as the browser is resized. Ultimately I plan on positioning an image but just using the text for now. I use the following code:

Code:
stage.addEventListener(Event.RESIZE, wResize);
function wResize(e:Event):void {

[code]......

View 0 Replies

Actionscript 3.0 :: Position The Tooltip Relative To The Object That Triggered It?

May 9, 2009

I have made a tooltip class for my project and I want to position the tooltip relative to the object that triggered it.e.g.

Code: Select all_button = new CustomButton("CLICK ME");
_button.addEventListener(MouseEvent.ROLL_OVER, showTooltip);
private function showTooltip():void
{

[code]...

How can I access the _button without hardcoding it like that?

View 9 Replies

ActionScript 2.0 :: Shift / Scale Relative To Position At Click

Aug 19, 2006

I've recently taken Krilnon's tutorial on interactive image panning, and have a need for more complexity. My image to be panned (relative to user's mouse movement) has several 'hot spot' buttons placed within. Each hot spot, when clicked, is to smoothly zoom and shift within the mask, with pertinent info displayed next to each, once zoom and shift is complete. almost like I'm making a motion tween, where the final position is known, but the start position is wherever the BG image is when the user clicks the nested button. I need to determine the x-position at the moment of click of the button (different for each button), and then, I think, use a simple-math "stagger-step" method of moving and scaling, until I've reached my final dest. here's the link to the tutorial I originally referenced:Url...

View 8 Replies

ActionScript 2.0 :: Position Clips Relative 2 Browser Window?

Jan 10, 2007

I want to position a clip near the end of the browser window and to make it fixed there, no matter on which screen resolution my site is viewed. I've tried already doing it using the external movie with fscommand, as well as with Stage.align, but then it applies to all the loaded movies. The rest of the content should be centered.

View 1 Replies

IDE :: Position MovieClips Relative To Flash Movie Size?

Nov 21, 2011

How to position Objects in flash so that they stay like 10px from left no matter the size of flash movie. Something like in flex.

And how to embed Flash movie in HTML so that it all worked correctly?

View 2 Replies

ActionScript 2.0 :: Image Pan - Want To Center/scale Relative To Position At Click?

Aug 19, 2006

I've recently taken Krilnon's tutorial on interactive image panning, and have a need for more complexity. My image to be panned (relative to user's mouse movement) has several 'hot spot' buttons placed within. Each hot spot, when clicked, is to smoothly zoom and shift within the mask, with pertinent info displayed next to each, once zoom and shift is complete. almost like I'm making a motion tween, where the final position is known, but the start position is wherever the BG image is when the user clicks the nested button. I need to determine the x-position at the moment of click of the button (different for each button), and then, I think, use a simple-math "stagger-step" method of moving and scaling, until I've reached my final dest. here's the link to the tutorial I originally referenced:If anyone knows of a tutorial or example out there, I'd love directions to it(them). or,

View 1 Replies

ActionScript 3.0 :: Make Code Simpler For Relative Position Of Each Movie Clip

Oct 13, 2009

i'm making an accordion menu with tweenlite, the menu works, but i want to know how can i make the code simpler for the relative position of each movie clip, i create a variable and override the variable inside the function for each movie, there is a better way to do it?[code]

View 4 Replies

Flex :: Calculate Line Number Relative To Cursor Position In TextArea?

Jun 11, 2009

How can i find line number in events like mouse clicked, key down and key up. And also highlight that line with color. I used TextArea.

View 1 Replies

ActionScript 3.0 :: Rotate MC Relative To Mouse?

Oct 29, 2009

I'm using the following code to rotate a MC on the Y axis that stops at a certain point. Is there any way to do the same using the tween class so it has a softer finish.

addEventListener(Event.ENTER_FRAME, mcRotation);
function mcRotation(event:Event):void
{
var controller:Number = mouseX - stage.stageWidth * 0.5

[Code].....

View 1 Replies

ActionScript 3.0 :: Prevent Scaling And Keep Position?

Jul 18, 2011

I have a project which has a background which is a swf that is scalable with the browser.However I do not want anything in the parent SWF to scale and want to position it in the top left of the browser regardless of size. how to do this in AS3 Currently it seems that the parent SWF is scaling everything as a result of a child swf on the stage.

View 7 Replies

ActionScript 2.0 :: Scaling In Relationship To X Position

Mar 9, 2005

Essentially I want a MC to take it's X position and magically set its x and yscale, so that when it is at an X of 0, it's xscale is 75, when it's at a X of 88, it's xscale is 100, and when it's at a X of 176, its scale is 75 again. But it needs to scale from 75 to 100 and back to 75 smoothly, while it's being moved by another script.

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved