IDE :: Changing An Object's Size Depending On Mouse Position?
Oct 6, 2009
I have a button symbol on my stage that I want to change size depending on where the mouse is on stage. ie: the y position of the mouse will make the x and y scale change (the symbol should get smaller as the mouse moves up the page and larger as it moves down - as if it is getting closer or further away).
View 1 Replies
Similar Posts:
Jun 8, 2004
I know this can't be to hard too achieve, but my actionscript skills aren't quite up to it yet.
- I have 5 frames within a MC.
- In this MC there is text saying "center", "left", "right", "up", "down" on each frame.
- All I want to be able to do is make the MC change to frame 3 "right" when my mouse moves to the right of the MC.
I know the script below is wrong, but would it go something like, this. Would I have to use angle and math or is there a simpler way to achieve this?
onClipEvent (mouseMove)
get x position
get y position[code]......
View 1 Replies
Jun 8, 2004
I know this can't be to hard too achieve, but my actionscript skills aren't quite up to it yet.
- I have 5 frames within a MC.
- In this MC there is text saying "center", "left", "right", "up", "down" on each frame.
- All I want to be able to do is make the MC change to frame 3 "right" when my mouse moves to the right of the MC.
onClipEvent (mouseMove)
get x position
get y position
if statement x= > -180 and y=> 0 (something like that)
_root.myMovieClip.gotoAndStop(3)
View 1 Replies
Jun 19, 2010
I'd like to make sort of gallery with previous/next buttons. And on each image you'd have circles/link over important parts of the image.So each image wold have these circles on different locations. Question: how can I make that dynamically? And that it's not to complicated for the editor of the site? One way would be to write in XML x and y positions.
View 0 Replies
Nov 5, 2003
I'm making a game...and I want to change my background image depending on where the character is. I thought I would make a MovieClip...with all the different background images on different keyframes. My question is....can I use AttachMovie, and if so...how do I reference the particular frame that I want to...? I've never used AttachMovie before, and wasn't sure of the syntax...and how to reference it...to go to a particular frame.
View 1 Replies
Jan 4, 2009
Ok, so I'm making a Myst-type game as a simple first application, and one of the things I need this to do is not have the arrow change to a finger when over a manipulable object. How do I either tell the program to change a certain cursor to another in a given context, or to keep it at default even in situations where
it would not be so (over a link, etc)?
This is probably a step beyond the questions I've asked so far in complexity but I'm sure you gurus are up to it. :)
View 3 Replies
Jun 22, 2005
I'm looking to a menu that scrolls vertically depending on the mouse position.I know that voetsjoeba has a cool scroller that does this, but loads XML and such. I'm just looking to scroll an MC up and down with easing depending on the mouse position.I like the way that the new XML thumbnail gallery that Kirupa put up scolls along the bottom, how about something like that?
View 4 Replies
Jun 5, 2010
I have created an animation which has frames with the head drawn in the various positions it needs to be in to look in all directions. Each frame is unique as it shows the head look up down sideways etc.What I need to do now is to make the movie clip play certain frames depending on the mouse position.I am having some trouble with the logic of how to do thisIs the best way to detect the mouse position then tell the movie clip to gotoandstop a certain frame depending on the mouse position?
View 2 Replies
Jan 30, 2007
I am trying to simulate a 3D navigation which changes the movement depending of the x and y mouse position.url...Does anyone know where I can find a tutorial step by step for it or something similar?
View 1 Replies
Jun 9, 2005
Does anyone know what I can do to change the claudio scroller so that it will scroll ease depending on the vertical mouse position?
View 4 Replies
Oct 9, 2007
I have recently followed a tutorial to make a movieclip in flash that makes buttons spin around a point depending on the mouse position. I have made my own version off this and would like to use it in a full flash website that i am making at the moment.
The only problem that i am having is with aligning this clip and as it is made up of script i cant physicly drag it to were i want it. I understand how to alighn this with x/y positioning but when i preview the flash in a web browser it is positioned correctly but then when i 'full screen' the browser this clip jumps about 4 inches down the page.
View 1 Replies
Nov 15, 2010
I load an SWF using a simple loader but it changes the main applications x/y position and size.Which loader do I use to load an swf that will maintain the position size of my app?
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.INIT, function handleInit(event:Event):void{
var UIDesigner:UIComponent = new UIComponent();
[code]......
View 3 Replies
Sep 5, 2011
im building my site now and i want to have background of hexagons that get visible only when the mouse is at certain distance of them, so i found out that i have to use as3, ive read some tutorials and other post and i tried the following code that i found online:
stage.addEventListener(Event.ENTER_FRAME, showDistance);
function showDistance(e:Event):void{
var distance:Number = (circle.x, mouseX, circle.y, mouseY);
[code].....
View 9 Replies
Mar 16, 2012
Is it possible to change the mouse-pointer position in fullscreen. I want my mousepointer never hits the left or right side screen walls.. in case it does so, it resets itself in between somewhere.
A fake mouse pointer using a movieclip, won't solve this problem, because after-all i have to save the mouse pointer from hitting screen-walls.
View 2 Replies
Nov 16, 2009
I want the diameter of the 'balls' orbit to change dependant on the position of the mouse but keep the point of rotation exactly the middle of the stage at all times.I.e. if the mouse is hovering over the exact center (both X+Y) of the stage then the 'ball' should have a tiny diameter of rotation (but contstantly follows the orbit in clockwise direction) whilst if you move the mouse towards the edge of the stage then the diameter of the orbit of the ball will increase.Here is the AS which controls a blank movieclip;
var sp:Sprite = new Sprite();
orb1.addChild(sp)
var g: Graphics =sp.graphics
[code]....
View 1 Replies
Sep 23, 2011
I am kind of new to javascript/html5. normally I would do that kind of stuff inside flash/as3. but since the iPad doesn't support that I need to switch the horse...I want to build a website where words are floating in position and size and if the mouse comes over one word it should draw some lines to all the other words. are there any frameworks one could use? the whole should look like a tag cloud with lines between the tags.
View 2 Replies
Nov 20, 2009
I want to do something which is probably pretty simple but I've got absolutely no idea how to do it!What I want is for the Alpha value of an object (movie clip) to change depending on the x position of the mouse. So when the mouse is at 0 the alpha of the object will be 0%, and when it's at 100 the alpha will be 100%
View 4 Replies
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
Nov 23, 2009
I have created a flash app in which there is a circle with circles plotted along it's circumference, it is rotated when the mouse is moved up or down. The rotation is drawn directly from the y position of the mouse pointer. What I would like to do is grade the movement some how so that the further down the mouse pointer goes the less impact on rotation the movement has.
My current code is like this:
myCircle.rotationZ = e.localY;
Is there some form of math formula I could use which would reduce the amount of rotation the greater the y position of the mouse position?
View 4 Replies
Jan 12, 2011
I am creating mouse scroller and when I insert actionscript my images wont move depending on the mouse movements..I am using Flash cs5 and Actionscript 2.0...this is my actionscript:
[Code]...
View 9 Replies
Nov 19, 2009
I added a Menu_mc on my stage. Initially, this should be at the center of the stage and when I click on it, it will tween on the upper left corner of the browser. However, when I resize the browser, the Menu_mc goes back to the center of the screen.
I have tried separating a different actionscript file where it is specifically for initialization of the object and another one for resizing. And then when I call it on my main AS file it goes like this:
Code:
// Add the symbols to stage
var Menu_mc = new Menu_MC();
addChild(Menu_mc);
[code]...
But it seems futile.
View 6 Replies
Oct 25, 2006
I've used the random motion tutorial, and got that working. Now i'd like things to resize themselves depending on where they are on the screen.. For example, if its at the very top, its 75% and if its at the bottom, 125%.
Code:
minsize = 75;
maxsize = 125;
dancerSize = _y;
[Code].....
View 4 Replies
Jan 9, 2010
is there a way to have (the postion of) objects be dependant of another one? I have attached a simple .fla file with two boxes (MovieClips) that grow in height. Since the position of the bottom box is constant, the top box soon expands "into" the one below so that parts of it are hidden. What I want is that the gap between those two objects stays constant (in this case 50px). So, is there any way to make the position of one object dependant on (the size of) another? Or is there any other "workaround"/tip you can give me?
View 18 Replies
Nov 8, 2010
I've run into a new problem, this time with positioning. I've narrowed down the line that's causing it--"block.y = block.y + block.height;" in SetOfBlocks.shiftDown. When I take it out, no problem. But with it in, instead of just dropping each block down by a block height, the affected blocks sometimes move up, and also often move about randomly within the X axis--although their new positions always keep them lined up with the 'grid', which is to say, within multiples of the block height and widths.
[Code]...
View 3 Replies
Feb 17, 2009
I'm wondering what codes I should use to get some movieclips get their depths swapped depending on their y position. The one with highest y is on top and etc.I have 3 movieclips named:
character1
character2
and character3
I've tried with some codes but they doesn't work.
View 0 Replies
Sep 14, 2011
I'm trying to make a movie clip move left or right depending if you move the cursor to the right or left on th screen. The clip is long and it have a lot of thumbnails and when it reaches the end of the stage has to stop. I have achieved this, but when the mc comes to the side of the stage it is getting slower and slower and I need it to move with a constant speed.
[Code]...
View 6 Replies
Mar 1, 2010
I have following problem:
Code:
title_txt = new TextInput( );
title_txt.setSize( 100, 20 );
[code]....
View 4 Replies
Apr 13, 2009
I'm building a site that will change the background depending time of day. I do want to show the time in the top of my page. What are good codes for showing a time and date in Flash and what would I use to change background depending on if the time is past 7PM or before.
Example.
If the time is before 7PM I want it to show a background with a clear blue sky. If not then the background will be a starry night. I'm using CS3.
View 2 Replies
Apr 6, 2011
I have three images and I want change the images size based on the scene size (default size is 1024x768). After each image has completely loaded I call bindableUtils.setter to set width/height when scene size changes but I don't know how to make a pointer or something like that. I'm using a public var img, but it only works with the last complete image.
Here is my code:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
[code].......
View 2 Replies
Mar 30, 2010
I'm working on a slideshow where I'm calling in photos from an xml file. How do I tell AS to resize the stage according to photo dimensions? Would I need to list the dimensions in the xml file? If so, how would I pull that into the fla file with AS?
View 6 Replies