Flex4 :: Difference Between Target And Current Target
Nov 28, 2011What is the difference between target and currenttarget in flex?What is the difference between Target and Current Target in Flex especially in mouse events.
View 2 RepliesWhat is the difference between target and currenttarget in flex?What is the difference between Target and Current Target in Flex especially in mouse events.
View 2 Replieswhats the difference between target and currentTarget properties.
View 9 RepliesI dont understand the difference, they both seems the same but... I guess they are not.
View 3 RepliesPossible 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 RepliesHere 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.
i am a little new to this ActionScript thing, and I find problem trying to understand this one thing:When I call an event listener function, then sometimes we use
View 1 Repliesthe difference between target and currenttarget in flex?
View 3 RepliesI'm creating a site that allows drag and drop navigation. Here's the current preview:
[URL]
My goal is to allow the user to freely navigate the desktop and explore at their leisure, however, for the user who's a little more impatient I want to offer an option allowing them to click a button on the bottom menu and have the desktop slide directly from the movieclip's current XY coordinates (whatever they are at the time), to a designated XY, and center on that specific section, easing into place.
I've got placeholder buttons, and placeholders for the desired targets, but I can't wrap my mind around the code needed to do it, nor have I found any examples that use the same technique with AS3.
I'm creating a site that allows drag and drop navigation.
Here's the current preview: [URL]
My goal is to allow the user to freely navigate the desktop and explore at their leisure, however, for the user who's a little more impatient I want to offer an option allowing them to click a button on the bottom menu and have the desktop slide directly from the movieclip's current XY coordinates (whatever they are at the time), to a designated XY, and center on that specific section, easing into place.
I've got placeholder buttons, and placeholders for the desired targets, but I can't wrap my mind around the code needed to do it, nor have I found any examples that use the same technique with AS3.
How to bring the current target into the movie clip?
If we can set the current target into "selectMovieClip" variable then i believe we should be able to rotate or manipulate it as a MovieClip.[code]...
At a certain point in an effects execution i would like to execute some code.
Say for example that i have a move effect on objectA and half way through this effect i want to make objectB disapear.
Is there any functionality built in to the spark effects framework to do this or do i need to implement the effect myself by hand?
On the attached exercise, is it possible to stop further items being dragged onto a target when the target box is full?
View 1 Repliesqi have a movieclip which is added to the stage:
var profileholder:profileHolder=new profileHolder ;
inside of profileholder is another movieclip(infoBtn) that acts as a button.when the mouse is over profileholder i want to do something with infoBtn like:
//profOver is the over state of profileholder
function profOver(e:Event) {
e.target.infoBtn.alpha=1;
}
this doesn't work and brings up this error:ReferenceError: Error #1069: Property infoBtn not found on flash.display.Loader and there is no default value.
at main_fla::MainTimeline/profOver()
i also tried:
function profOver(e:Event) {
var item:profileHolder=e.target as profileHolder;
item.infoBtn.alpha=1;
}
and get this error:TypeError: Error #1009: Cannot access a property or method of a null object reference.
i'm new to AS3. Couldn't understand what some of the explanations out there are getting at, so i decided to post it here. In the code example below, what does event.target & event.currentTarget point to?
[Code]...
i don't know why this isn't working.i got a button. and when it's pressed, i need it to go and play a frame in a movie clip. i'll test it and then when i click on it, i get this:
Target not found: Target="whoweare" Base="_level0.instance20.instance48.instance49"
this is the code that i am using:
on (press) {
tellTarget ("whoweare") {
gotoAndPlay (51);
}
}
so, i'm making an animated rollover, and i get an output error that says this:
Target not found: Target="_root.icon01" Base="_level0"
i have no idea what the base="_level0" means.
Through attachMovie I have loaded an mc from the library onto the stage into "holder_mc".
myButton.onRelease = function () {
if (currentWork != "holder_mc.myWork1_mc") {
holder_mc.attachMovie("myWork_mc","myWork1_mc", getNextHighestDepth());
currentWork = "holder_mc.myWork1_mc";
}
}
This works.
However, there are a couple of buttons (mc) inside "myWork1_mc" which skips through a few slides in the myWork1_mc clip that I cannot target. I thought using:
holder_mc.myWork1_mc.buttonName_mc.onRelease = function () {
trace("MC_pressed");
}
... would work. My curser doesn't even change to the hand symbol. How do I target an dymanically loaded MC from the library which is inside an empty holder MC on the stage via attachMovie? What am i missing? Believe me, I have spent hours trying to google it.
Note: at this stage there is no other script on "holder_mc", but there will be at a later date, but I'll cross that bridge when I get to it. Also, the buttons work when I place the MC onto the stage and not use attachMovie.
I have a simple button that goes to a URL when clicked, but it's opening a new window. I want it to target "_self"-- but I'm getting errors. How do I properly target the same window?
[Code]..
Seems like AS3 is more about writing code than AS2.I would normally write the code on the button:
Code:
on(release){
getURL("http://sample.com". "_blank");
}
Instead in AS3 I have to do this for a button action:
Code:
myButton.addEventListener(MouseEvent.CLICK, myButtonFunction);
function myButtonFunction(event: MouseEvent) {
var request:URLRequest = new URLRequest("http://www.sample.com");
navigateToURL(request);
}
How do I add the _blank target function to this AS3 code. I am still trying to get use to this AS3 concept.
I used to use an old school method in AS2 to talk to a movieclip to go to different states like on rollover but how do I do this in AS3 now?
Code:
on (rollOver) {
with (myclip) {
gotoAndStop("on");
}
}
I know that with went out a long time ago but it worked!I know in AS3 to handle a click you have to do this:
Code:
mybtn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
gotoAndStop(1);
}
what I want to do with targeting a rollover with a button.
I need to have a button to target a movie clip in a separate swf placed in a separate window.
//
on(release){
getURL(theotherswf.html+nameof_mc);
}
I have a flash template that I added a flash and xml driven component to. The component is a carousel menu with a lightbox that displays images. The lightbox part of it keeps loading behind my flash page, no matter what I set the z-index to on the lightbox.css. Is there a way to control the z-index of the flash file in the website's style.css? I tried adding it to the Body of the css but that doesn't work. How do I target the swf? I've never used css before. How to get it to load the lightbox above the flash.
View 2 Repliesdoes anyone know how i can matching random value. what kind algorithm that i need to use? the value is no always close to the first value. ex : array 6 x 6. location first value is in 1.1 and the second value is in 3.4. the question is what algorithm i have to use to get value from target value?
View 4 RepliesI have a monster_mc that shoots a bullet_mc at a target_mc.When I click the Keyboard.RIGHT the bullet jumps once then hesitates or pauses then continues -=25 pixels, instead of shooting smoothly.Am I missing something here?, can I make it perform better?
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
target_mc.stop();
function keyPressed(event:KeyboardEvent):void[code].....
I want to know why I can't use this code PHP Code:
[Code]...
I know the problem is Code: xml=e.target.data as XML; but I want to know why I can't use the as XML instead of XML(e.target.data)?
I am using AS3 and PHP. I have created a flash animation and and it put in a index.php file. Its a web site, some pages are in flash and some pages are (like shopping cart) not in flash. My problem is when i am in pure php page (cart page) when i click the link about us, it should go a particular frame or particular content in the flash, instead of running from the beginning.
View 1 RepliesI have a simple event listener which calls a functions which first uses a switch case statement to determine what evt.target was pressed by name so I can assign info there--presently I just have trace statements--the problem is that it only works once and then I just get instance29 and the switch case evaluates to the default.
Code:
lifering1.addEventListener(MouseEvent.MOUSE_OVER, playSplash,false,0,true);
function playSplash(evt:MouseEvent):void
{
[Code].....
Its easier explained if I just write down the code:
function loadMc(frame:Number){
aNum = "array"+frame;
array1 = ["mcname", "identifier", "200"];
[code].....
I want to redirect the following code when the target isn't
available.
function buttonClick(event:MouseEvent):void
{
gotoAndStop(event.target.name);
[Code]....
The code works great but I'm building a large site and would like to have a default swf that loads when the target isn't available. I tried various if statements when event.target.name == null but haven't been able to get any of them to work.
How would you get the name of the parent of a movieclip? below is only some of the options I tried to trace.
function getParentName(e:MouseEvent):void{
trace(e.target.parent.name);
trace(parent(e.target));
[Code]....