Flex :: Intersects Sprite And Get CurrentTarget?
Jan 10, 2011
I have create a few sprites consist of various music notes, when the cursor sprite move over to one of the notes, it would blink using intersect. I have no idea on how to make the cursor detect which note it overlap.
View 1 Replies
Similar Posts:
Feb 25, 2010
the difference between target and currenttarget in flex?
View 3 Replies
Aug 24, 2009
I'm making a game and have been stuck for a few weeks on finding out when a freeform path drawn by the player self intersects.
I tried per-pixel alpha value collision detection but it's too sensitive and sometimes an aliased diagonal line will trigger a collision.
I'm trying to get it like the game Planet Cruncher. Doesn't seem to use alpha values to determine line self intersection since the line's color is solid. [URL]
View 2 Replies
Mar 11, 2011
Given a MovieClip containing a vectorshape (loaded from the library) - is there a way to check whether a line (from point(x1,y2) to point(x2,y2) intersects this shape?
View 1 Replies
Apr 13, 2005
I'm making a very simple game that lets you draw a curve by hand (using lineTo to the mouse position on mousemove) but now, I need to check wether the line intersects wiith another part of the same line (e.g. a loop)
I first used an onrollover command, and that worked, but not always because the mouse moved too fast (same with hittest with mouse). Then I pre-drawed the line in another mc, used hittest on it, and if it wasn't intersecting, draw it in the real mc. But that didn't work because it used the bounds to test. I guess the best way is to use some mathematical formula, but that would mean I have to save all my coordinates in an array..
View 5 Replies
Mar 5, 2010
I created a class, extended the sprite class, and now in the constructor I am trying to set the Sprite's width and height properties which are inherited from the DisplayObject. However, after I set this.width and this.height, and print the values, I get 0 for both.
What the heck is going on? When I view the livedocs I see that DisplayObject has width and height listed as public properties. I have been able to instantiate a Sprite directly, and set the width and height after it's been instantiated, so I don't get it.
package {
import flash.display.*;
public class ScrollBar extends Sprite {[code].....
View 1 Replies
Apr 4, 2011
I've got a sprite which I want to temporarily hide... But changing the .visible property doesn't do what I expect. The code looks roughly like this:
[Code]...
View 1 Replies
Mar 2, 2009
I created a new AS3 document (550px by 400px) and added the following code to the first frame.
However, when I run this, I see nothing painted on the screen at all, the screen remains completely white.[code]...
View 3 Replies
Jul 6, 2011
I'm doing a simple rotation on a sprite but there's a weird behavior where the sprite does not rotate around it's top left. I think I'm rotating along the top left of the test class instead of the sprite child. I would like to rotate the rectangle around it's top left corner (kinda like a clock hand). The code is pretty short so I'll let the code + pictures explain my problem:
package
{
import flash.display.Sprite;
[Code]....
I've read a lot of stuff about rotating around a fixed point, I've tried doing it with movieclips instead of sprites, I even copy pasted a tutorial on rotation and nothing works.
View 3 Replies
May 27, 2008
[Code]...
Then the numericStepper is drawn as if it is squished to 20% its normal height. If I pre-set mySprite width and height before adding the numericstepper, the trace output is 0,0 after adding it and it is not displayed at all. Is there some way I can make the sprite only adjust to correctly fit the numericStepper OR resize it afterwards without distorting the numericStepper component?
View 2 Replies
Jan 16, 2009
I am loading a series of thumnails through an XML file into a scrolling movieClip. I am able to get all of the images to load and scroll and even control their alpha value using event.currentTarget. What I am having a problem with is getting the corresponding XML attribute(@title) to load into a dynamic text field.Here is a snippet of my XML file:
<thumbs>
<thumb img="http:url_1"
title="Title One" />[code]....
The thumbnail alpha changes and the text field changes to the text that is defined by the first title attribute. What I need to figure out is how to use a variable instead of the "#". I'm assuming that I should be able to make use of event.currentTarget like I did to change the alpha of the thumbail movieClip.
View 7 Replies
Feb 18, 2011
I have 3 movieclips. Each sends the game to one level. Inside each movieclip theres more movieclips.
[Code]...
View 2 Replies
Oct 25, 2011
i'm wondering how i can run a function that has the same name as the current target. so when i click a button with the instance name "notes" this will run the "notes" function e.g
ActionScript Code:
evt.currentTarget.name();//run the function with the same name as the target
this doesn't work and returns a Error #1006: value is not a function.
View 2 Replies
Nov 10, 2011
If you have a series of sprites in a movie clip, can you get the currentTarget.currentTarget as it were? So if a sprite throws a mouse event, I can capture that?
Sorry if that's gobbledegook.
I have a movie clip called myMC. In that are a series of sprites sitting in a vertical row. On mouse up I want to know which sprite I was over. currentTarget gives me the parent movie clip, can I get the sprite underneath?
View 7 Replies
Mar 14, 2009
AS3 coding, and despite being able to find posts about most of my problems, this problem has stumped me, and I'm not certain what words to search for.I'm trying to make a list of MCs on my stage to link to external URLs.I figured the following would work, but it just pulls the 'event.currentTarget.name+"URL"'the instance names of the MCs are "idlink" and "findStore"Is there a way I can get the loadLink variable to pull the URL instead of the "idlinkURL" string, or is my logic for this completely backwards?
Code:
var buyLinks:Array = [idlink, findStore];
// add listeners to the menu array
[code].....
View 1 Replies
Mar 19, 2009
whats the difference between target and currentTarget properties.
View 9 Replies
Apr 13, 2010
Have 8 mc's, and when I click one want something to happen to all except the one that I clicked.My question is how do I declare "all except currentTarget" for a MouseEvent?
View 2 Replies
Sep 23, 2011
Both of sprite.width and sprite.scaleX can be used for scale a sprite. Is possible sprite.scaleX depends on screen size?
View 2 Replies
Jun 19, 2009
It has been a great resource of the years. No my problem. I am trying to dynamically resize a sprite that has a line drawn into it. Here is my code:
[Code]...
View 4 Replies
Jul 4, 2010
I have a set of 6 buttons and upon clicking one of the buttons i want to tween the others that were not clicked to fade out.
View 3 Replies
May 7, 2011
I dont understand the difference, they both seems the same but... I guess they are not.
View 3 Replies
Dec 15, 2011
Possible Duplicate: Difference between e.target and e.currentTarget I don't really understand the difference between these two event.target and event.CurrentTarget and explanation.
View 2 Replies
Jun 20, 2010
I'm new to AS3 and was wondering how I can use something like:
var mc:MovieClip = MovieClip(e.currentTarget);
As part of another instance name.
For example if the currentTarget was a move clip with an instance name of "oneNav" and then I wanted to control a movieclip with the name of "SuboneNav", how could I do it? All the variations of concatenation I'm familiar with weren't working. I even tied getting e.currentTarget.name instead but there always seems to be an issue.
View 5 Replies
Feb 11, 2011
I know I'm missing something rather basic here, but can't figure it out. I want to take a "currentlySelected" target of a hit test and attach it to a movieClip container. It traces as an object, but I can't figure out how to translate this to a movieClip. I'm sure I've done this before--- but I'm drawing a blank.
Code:
trace(currentlySelected + " hit test box 1")
currentlySelected.x=box1.x;
[code].....
View 1 Replies
Feb 11, 2009
Here is what the help defines both:
targetproperty
The event target. This property contains the target node. For example, if a user clicks an OK button, the target node is the display list node containing that button.
currentTargetproperty
The object that is actively processing the Event object with an event listener. For example, if a user clicks an OK button, the current target could be the node containing that button or one of its ancestors that has registered an event listener for that event.
View 2 Replies
Mar 10, 2009
is there something similar to currentTarget with dropTarget?Right now dropTarget will get me the "lowest" DisplayObject possible, but I'd like to get the top-most. I cannot use parent as my objects are of different nesting depths.
View 1 Replies
Feb 1, 2010
i'm trying to create a menu system where each item expands in height when clicked but is then collapsed back to the original state when other items are clicked.m is the height of the expanded state. n is the height of the collapsed state. i is the number tacked on the instance name.Also, I'm using Tweener for smoother transitions. I've done this already by copying out the code but it's 24 items so 24x24 lines of code when I'd like to be able to do it a little more elegantly. Here's roughly what I want to do, but don't know if it's possible:[code]So every box below the one that's been clicked on most recently gets the value of m added to the y value and every box above doesn't.Is it possible to retrieve the value of the variable i that corresponds to the currentTarget?
View 1 Replies
Mar 2, 2010
Quick question, what's the different between these:
[Code]...
I get the basic concept, you're targeting the object that you want to use from the listener in the function. But when do you use which?
View 2 Replies
Jul 4, 2010
i have a set of 6 buttons and upon clicking one of the buttons i want to tween the others that were not clicked to fade out. how do i do this? i know how to do the tween part but i dont know how to get a hold of the buttons that are not currentTarget...
View 2 Replies
Dec 27, 2010
How do I create multiple instance of the same sprite with different name as in shap1,shape2, shape3, etc. Then the function will change the color of the sprite through getChildByName? Whether I create a new instance, the old sprite will be overwrite by the new sprite and when I call the old "shape1", it will be null. How do I retain all sprite?
var c:UIComponent = new UIComponent();
var s:Sprite = new Sprite();
private function shapeCreate() {
[code].....
View 1 Replies