Actionscript :: Finding A Child Control Based On X & Y Coordinate
Aug 17, 2010
In Flex/Actionscript.When writing an on mouseMove event on a Canvas control for example, how could I check to see what control if any is under the mouse pointer at a particular coordinate?
I have 3 square. smallest square s3 is inside s2. s2 is in side s1. each is 10px larger [code]how can I find the coordinate of child in its parent's coordinate system?
I have enemies being dynamically spawned from a Class. They are constantly moving but I need them to shoot at the player when their X is the same as the Players. I have the enemies being put into an array for collision detection
I'm trying to find out if there is way through TweenLite to continuously check the Y position of my movieclip as it's tweening?I have my movie clip tweening from point A to point C and while it's passing B, I want something to happen (right now I'm just running a trace). I've tried using the onUpdate function but it's only tracing the original Y position everytime
Iīd like to know if itīs possible to find a minimum y point (where the shape ends) of a shape, in a given x coordinate.
Example: I have a complex shape like a big "S". Suppose the "S" minimum x coordinate is 0. How can I find the minimum y point of the "S" (again, where the shape ends) in the x coordinate of 14?
Here is the image: I need to find the y coordinate (or point) of the blue point in the image.
Im busy with a rpg graphics engine, while discovering as3 whilst doing it. So I made different classes for the world, tile managers and players, etc. But since I have a 45 degrees SNES rpg view on my world I need depth sorting based on their Y coordinate. At least my npc's and the middle tile layer need that. But all these objects are now all different classes now and the swapchilderen method is quite cumbersome. Do I need a whole messy cumbersome method to sort specific tiles and npc's based on their y coordinate or is there a simpler method to have proper depth sorting in as3?
I expected the trace command at the end of this code to return 0, but it returns 100. Does anyone know why mc's y coordinate value is not updated after adding it a child?[code]...
I've created a map of Montana counties. Each county is a seperate MC withing the larger parent clip (allcnt_mc). When a county is clicked on, I'd like to center that county on the stage and zoom to its extent. The challenging part has been telling the parent (allcnt_mc) where to tween to. Since each individual county is a child of the parent, they have their own coordinate space referencing that of the parent.
Is there a way I can query the location (x,y) of a child in the parent's coordinate space? With this number, I could calculate the distanct between the parent's current reg. point and that of the child, indicating the distance that the parent would have to move to be centered on the stage. I was trying to use localToGlobal but could not figure out how to use it.
I am trying to manipulate (move up and down, enable/disable and launch a form) child controls inside a panel control. However I am unable to get the id of the child control on which the click event occurs. To illustrate, I am trying to create similar functionality as is available. I am trying to create the up-down buttons that you see in the image at http:[url].......
I have a menu MovieClip that has its buttons inside of it. I have the menu with a MousEvent.CLICK and trying to figure a way to register what you are clicking on.
How does one find the position of a child movieclip within a parent movieclip relative to the stage? Whenever I refer to the position of the target movieclip, it gives me a number of what I'm not quite sure it refers to. I want to know the position of a an object as it is seen drawn on the stage
i was wondering if there was something that allowed you to grab any 2d point that exists inside a movieclip and grab the 3d position of that exact point...
for example i have a rectangle movieclip on the stage .. and its rotate on the x axis 75 degrees.. registration of the clip is at bottom middle.. so when it rotates the bottom stays in the same spot and everything rotates around it..
now what if i wanted to know the exact x,y,z of the top edge of the clip..
is there a function similar to localToGlobal that would take the x,y coordinate inside the clip and spit back a global 3d point .. (i guess its called a Vector3D)
First i want to say its my first post and i've been diging straight up gold from this site and i love it and everyone out there smart enough to give out solutions.So basically am writing a game and i have bezier curve that controls where an actor moves. Am using only 3 points (start, control1, end) and everything is fine.Now i want to create a bezier curve that passes through a certain point (r1) at t = 0.5 . The problem being that i have my start point, my end point and my point (r1) at t=0.5, and i need to find the control point.
Does anyone know of an existing flash (swf) based audio control that is available (free or commercial) that provides a timeline waveform visualization with the ability to select and play a portion of the timeline?For example, the flash control used by this website... http:[url]....It does exactly what I'm wanting to do. I need this capability to allow a user to mark a section of an audio file which can then be synchronized with other visual elements on a web page using javascript.
It is important that the user be able to see the wave form of the audio because they can save time by visually guessing where certain sounds start and end in a file. The user can then select this block of the audio and preview the sound and tweak the selection if need be.
I have a thumbs_mc with thumbnail images. Within thumbs_mc, I have a transparent overlay_mc that functions as a button. Mouse over the overlay_mc and the alpha chages so there is a tint over that particular thumbnailWhen overlay_mc is clicked, the main timeline goes to a particular frame label.What I need to do is have the position of the playhead on the main timeline also determine the alpha of the overlay_mc so the viewer knows which thumbnail is playing.
I am trying to make an animation where the user can mouse over a small MC at the top of the stage, which controls the movement of another larger MC at the bottom of the stage.I am thinking that 'points' (which I know nothing about) might be the way to go. The other thing is that it needs to be fluid motion. Am I at least on the right track with points and mouse_move or is there a better approach for this?
I'm writing a game with Flash CS5/AS 3.0 that tries to simulate depth of field by drawing all the relevant Movie Clips based on their Y position in ascending order, i.e. things lower on the stage overlap things higher on the stage. A MovieClip with a Y position of 10 would therefore need to have a lower index compared to a MovieClip with a Y position of 20, so the second one gets drawn on top of the first.
I wrote a quick and dirty function just to test this. During the trace, I've noticed that the truck's index hits 0 when I go near the top of the stage, but if I go too far up it will completely disappear from the stage. Trace then starts generating this error:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller. at flash.display::DisplayObjectContainer/getChildIndex() at EICT::Game/ReorganizeDisplayIndexes()
I have 3 text fields that display weather conditions from the Weather.com XML web service. The 3 text fields need to be visible only during a certain segment of the Flash Video that is set as the application's background. Do I use AS3 to specify visiblity? If so, how do I reference a certain range of frames in which the fields should be visible?
I'm trying to integrate Seam and Flex with GraniteDS, with the goal of implemenenting a code generation tool for main use cases of CRUD operations.One of my needs is to have the possibility to generate a combo box to reference a parent entity from another. For example, a state combo box in my county edition/creation screen.
What I am trying to do is get the animation of the audio levels (red bars next to the power switch) to only happen while a video is actually playing (videos are in the video gallery section). I have the animation done and I can easily get it to start and stop based on pressing the play and stop buttons, but since they start and pause the video you would get instances where the video isn't playing but the audio levels would be animated, which I don't want.
Here is an example of the code in the play button (using NetConnection and NetStream to play the videos):
The only way I can think to make it work exactly as I want it is to have Flash look to see if the video is actually playing or not and I can't figure out how to do this or if its even possible using the NetStream command I am using to start and stop the videos.
I've loaded an external SWF into an empty MC named "M1" using this[code]...
Now I want to control the timeline of the external SWF from the main movie timeline. How do I reference the child of the M1 object in AS3? example: M1.child.stop(); (doesn't work of course).
I made a class that creates a "kind" of menu with data from a XML file and basically what it does when it is called is create a emptyMC (a container), add a childMC (a square) and add another child (a text label). When I create the container I'm trying to add a MouseEvent that can act on each the container instances but all I can get is a MouseEvent on object containing all the added MCs. The code follows.[CODE].....
I am trying to control movement of an object in one frame based on timing. I have the movement working correctly. What I need assistance on is determining when it should move.I tried using timer() mod 1000 but am having no luck.What is a way that I can implement this portion?
I have a main .swf from which I am loading a child .swf into using this code.[code] Once the .swf is loaded in though, I want to be able to use basic timeline control functions like stop(); and gotoAndPlay(); on the child .swf from the parent.
I'm trying to set up a form that presents a combobox when an ArrayCollection it's bound to has several items, and doesn't present one when it's empty or only has one item. I've tried doing this by creating this class, but unfortunately, the data provider I've bound to is never not empty at the time the setter executes.
public class ComboboxOrFail extends ComboBox { public function ComboboxOrFail() {
For instance, in the below code a parent can control a SWF child's function "alert ()". But how a SWF child can control parent's function "ReceivingChildMsg()" ?