Actionscript 3 :: Detect Element Transformation Type For Rotated Elements Depending On Cursor Position?
Feb 2, 2010
I've written the following method (in actionscript 3, it's a flash application) which returns what transformation type is required for the current mouse position in relation to a given element position.
An element can be moved, scaled and rotated. This method returns if any of these transformations are applicable with the given coordinates[code]...
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. :)
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.
I'm trying to make a movie clip move left or right depending if you move the cursor to the right or left on the 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.
This is the code: var x_down:Number = 2900; var end:Number = -((x_down)/.8 + 50); var key:Number; var c_key:Number; var start1: Tween = new Tween( padre_mc, "x", Regular.easeInOut, padre_mc.x, (padre_mc.x + 280), 1, true); [Code] .....
I have a couple of images, representing tents, that look like this: The red and blue parts on each side of the tents are doorways, and several tents can be connected together via these doorways. For example, I want to connect the two blue doorways so that they match up like in this picture: If the first tent is stationary, around which point do I rotate the second tent and how do I calculate where to place it?
Currently, I have the upper left corner of each doorway as an x and a y value, together with the width and direction (in degrees) of the door. I'm treating the doorways as one dimensional, so they don't have heights. Would another representation suit this better? Perhaps a start point and an end point plus direction?
I have an Input Text area that users can edit and then submit. I need to be able to show, on screen, the cursor's current position as they type. I don't need to know where the mouse is but all work-arounds I've found so far can only tell me the mouse position. The font for the text is 'courier' or 'courier new' and the Input Text area is scrollable.
does anyone know how to make the initial text in an input text box disappear once your cursor changes from the arrow to the type cursor? For example, I have an input text box which has the text visible saying "enter your email address here" I want this text to disappear automatically when the user goes to type something there...
And so on for multiple people who are all asked the same 13 questions (q0 - q12).I am trying to push these into an array in action script like so:
function push_array(e:Event):void { flashmo_xml = XML(e.target.data);[code].....
(NOTE: the array questions[] contains strings of all the questions and the xml file contains the answers in case that wasn't clear) However this is not working. I know there must be a way to do this rather than getting all the questions individually without a for() loop.
Isn't there a way to loop over each image in the hgroup and add the eventhandler? Something like this:
[code]...
My teacher told me this isn't possible but in case of 10+ images, I can't imagine doing it for every image separately. There has to be a better way to do this, no?
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%.
In below class I ave declared an array "selectedOptions". In click event Im storing the values in it. But everytime I click on the object the array gets initialized and stores the clicked element rather storing all the elements one by one. Could you tell me the reason?
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:
I have a problem positioning a Flash element inside a div tag. The problem is, that the flash element is changing it's size based on the user input. I need a way how I can dynamically get the actual size of the flash element, and to change the behavior of the div element the flash is integrated in. actually I want to place it in the middle of the div. right now I gave the flash element width and height of 100% but that way I can not center the element inside the div...
but i realize i do not know the syntax of what i want to do. So i have an event handler and i want to do different things depending on the object type. i could do
I have an array of strings to set them into the combo box, a drop down combo box. I will select an element in the drop down combo box and press the button "delete". It will delete the element from the combo box. but when I come to the last combo box, im unable to delete it off because it does not get pass this line.[code]...
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?
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).
In a preview post, without success, I was trying to do an Elastic Menu in AS3.The problem creating the menu with differents elements and submenus is resolved.Now, I need to relocate the menu elements dinamicly through TweenLite.For that, I use this method named posicionar();
Code:
private function posicionar():void { for (i=0; i<tamArray-1; i++) { var elemento=itemArray[i+1];
[code]....
As I say in the commented codeline, the Tween doesn't get the right destination.
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)
knows the AS o the code to detect "how many elements are in a folder"?I made a great photo gallery with a two buttons next and prev, and a preloaded photo. It works fine but i want to optimisize this script...
I fixe the number of photos present in my folder manualy for exemple 15. When pushing next button my var increase +1 , and when my var=15 then i put it in var=1 to start again from the begining.I would like my script detect automaticly how many photos are in my folder, in my case: 15...
If you have a group of movie clips stored in an array and the movie cliops are placed on the stage randomly, and use your arrow keys to move a box on top of one of the movie clips - how can you "tell" Flash which movie clip you clicked on?
Right now I've got a for loop going which loops through the array that has stored the movie clip instances, presumably the hitTestObject would eventually get a hit...But this doesn't work, especially inside an event handler where when I press the right arrow on my keyboard.
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?
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.
I have an empty mc called "attachmcextra".Into this empty mc is attached another mc called "mcnote" that contains a texto box named "loadnote". So it`s path would be:_root.attachextra.mcnote.loadnoteThe following code is set to the mc "attachextra":
onClipEvent (load) { //set inicial position this.posY = 20;
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?
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.