ActionScript 3.0 :: Detecting If An Event Has "stopped Propagating" Or Been "cancelled"?
Dec 17, 2010
If someone hands you a simple event, is there any way of telling if the event has been cancelled or if the stopPropagation() or stopImmediatePropagation() commands have been run yet?
View 1 Replies
Similar Posts:
Jan 27, 2012
I am trying to understand event propagation in Flex framework and have a following doubt on it:
Scenario: I have a built-in component DropDownList on change of which I want to create a custom event refreshPreview and want to propagate it to a custom component PictureComponent.
In the custom component's mxml, I have added the Metadata directive as follows to register a refreshPreview event with the compiler
<fx:Metadata>
[Event(name="refreshPreview", type="flash.events.Event")]
</fx:Metadata>
Layout Details: In my main mxml application I have laid out DropDownList and the custom component such that both are siblings (i.e. have a common indirect parent)
e.g.
<s:Group id="contentGroup">
<s:Group id="formGroup">
<s:Form x="11"
[Code]....
I am seeing that the refreshPreview event is not getting propagated to the custom component.
I doubt this is because the built-in component is a sibling of the target (where the event got generated) and not a parent. how to make refreshPreview event propagate to custom component?
View 1 Replies
Oct 11, 2011
I have several event listeners configured to listen for a click event on a control.I don't know if this is a correct assumption, but I believe I have one configured to listen "first". After the first listener catches the event, it will pass control to the remaining listeners (if needed). This basically tells the user "you're trying to navigate somewhere, but you have unsaved changes, do you want to 1) save and continue 2) discard changes and continue 3) return and don't continue.Here's the sample code for setting up the listeners,[code]The call for dispatchEvent(unsavedEvent.clone()); doesn't seem to work (or at least the event is not being captured by continueOn) At first I tried redispatching the event without the clone() call, but that didn't work either.
View 1 Replies
Feb 24, 2011
I embedded a small swf file into my MXML file and would like to prevent users from navigating to next page until the embedded swf finished (mean stop running)How can I catch the event when the embedded swf stopped?I know when the movie begins to play as the code below but I don't know how to get when it stoppedThis is my first ever try to use Adobe Flash Builder
Code:
<![CDATA[
public function loadMovie(event:Event):void
{
Alert.show("Hello1.");
[code]....
View 3 Replies
Sep 21, 2009
I am loading images 1 after the other using:
var pathToPics = "portfolio/100_design/";
var preLoader:MovieClip = this;
var externalSWFs:Array = [pathToPics+"0.swf", pathToPics+"1.swf", pathToPics+"2.swf", pathToPics+"3.swf", pathToPics+"4.swf"];
[Code]...
View 3 Replies
Oct 24, 2011
I'm thinking of making a movieclip which stops itself at certain points (just with stop(); at certain keyframes in the movieclip timeline), then the user is prompted to continue the clip.
What is the best why to listen for the stopping of the movieclip? I think I want an event listener that detects when the movieclip is stopped, but I don't know if there is one.
View 4 Replies
Dec 14, 2011
I have a viewstack which implements a 'wizard' interface for doing new orders. On the last page of the wizard, there is a button, with a fake accelerator on it, by which, if they press 'o', they can start the process over again.
Below is my handler:
protected function _keyDownHandler(e:KeyboardEvent):void
{
if((e.charCode == 111)) {
[Code]....
The problem is that when the user gets back to page 1 of the wizard, the 'o' the user just typed is now entered into a datagrid filtering textbox (filter by last names starting with 'o'), which is not what is desired.
As you can see, I've made some attempts at forbidding this interaction, but it appears to be not enough, even though the model.orderNew() bit contains all the code to swap the viewstack pages around, re-setting the focus to the txtSearchFilter, etc..
It appears that e.cancelable == false, which is probably why I'm getting this behavior..but the documentation says that KEY_DOWN IS cancelable, so..
How can I keep the keypress from propagating to the form ?
View 3 Replies
Mar 16, 2009
i want to put a condition on the button event on (release) to check which frame of the movie symbol is stopped. something like if(frame 3 is stoped) gotoAndPlay(14).
View 3 Replies
Nov 9, 2009
I am trying to detect the key down event for the alt key in flex. I have a standard event listener for KeyboardEvent.KEY_DOWN and KeyboardEvent.KEY_UP but don't get any response for the alt key (or ctrl key).
I know I can detect if the alt key was pressed via a mouse event, but I want to update the cursor when the alt key is pressed to show it will perform a different action from when it's not pressed.
I am using Safari on a Mac for developing so let me know if perhaps it's an isolated issue.
View 4 Replies
Mar 28, 2011
I'm building a drag and drop quiz. each draggable mc (drag#) has a base class of DragDrop. I want to detect when an drag mc has been dropped on a target
Code:
if(this.hitTestObject(target)) {}
And then add a new drag from the drops Array. so that each time a drag finds its target a new one appears. I tried to make a public var named dropped to switch from "yes" to "no" in the drop function. and even tried making the drop function public.
This code is on the timeline
stop();
var drag1:Drag1;
drag1 = new Drag1;
addChild(drag1);
drag1.x = 100;
drag1.y = 100;
[Code] .....
View 8 Replies
May 24, 2010
Trying to detect a browser close event and send some data to the database when the user closes the browser window...but can't seem to get it to work.[code]
View 6 Replies
Oct 26, 2009
All of a sudden I was working and Flash CS3 crashed. The Windows Vista pop up said Adobe Flash CS3 has stopped working. So I figured it does that once in a while. But, after restarting my computer I opened up Flash and went to create a new Flash File and the same thing happened. It was only when I went to create a new file or open a file is when it crashes. Flash opens up fine, but screws up when I try to do anything with regards to actually working with it. So after I re-installed CS3, still nothing. I need this program and would like it to work.
View 2 Replies
Aug 8, 2011
I had a project which was successfully loading images from an XML file to make a Flash gallery. However, it seems to have suddenly stopped working. I've done troubleshooting and found that it is because the SWF is no longer loading the XML file. However, I had not messed with the SWF. I went into the FLA file and the code was the same. Here it is, for a reference.
[Code]...
View 2 Replies
Aug 18, 2009
I have a movie clip within my flash movie, call it M1, that consists of an image fading in and out. I have actionscript attached to the movie clip that is supposed to play the clip when the mouse rolls over it, and stop when the mouse rolls off. This works perfectly.
I have other things going on in the timeline, and I want the flash movie to load with M1 stopped, and for M1 to never do anything unless the mouse rolls over it. So I have actionscript on various frames telling M1 to stop (to prevent it from playing when the timeline moves forward). The problem is that whenever the movie reaches one of these frames, M1 resets to its default state... still stopped but it jumps from whatever frame M1 was stopped at, to the first frame within M1.
Is there a way to have the movie clip (M1) default to being stopped, so that these timeline commands aren't necessary?
View 3 Replies
Aug 27, 2009
Is it possible to continuously play an MC that is sitting inside another MC that is occasionally stopped?
View 4 Replies
Aug 26, 2009
I have a movie in my library which I've assigned a class so I can attach it to the stage in my code. This movie has stop() markers along it.
I have it fade in and play when the user clicks a button and it stops when it hits a marker (stop()) Now I want it to fade back out once it stops.
Is there an eventlistener that I can put in to say the movie has stopped?
I tried putting a call to the fade out function (on main timeline) in the video with the stop()'s but knew it wouldn't work.
View 1 Replies
Jan 10, 2010
I'm new to flash, knowing only a couple of commands such as stop(); and gotoAndPlay.
I'm creating a UI menu for the beginning of a flash project. On a few layers, I have objects and buttons while the "stop();" command is applied to the frame to keep them on the screen as a Title screen or menu-like idea.
My problem is that I would like a animation, or a movie clip, or something that is looping in the background for a more detailed menu screen.. However, I can't figure out how to run the animation while the current frame is stopped.
View 2 Replies
Jun 11, 2010
[Code]....
I wrote it originally in as2 and I tried to translate it to as3 and it stopped working. It's suppose to move the player towards another player. this is just the part of the script that doesn't work
View 1 Replies
Sep 18, 2011
is there a way to check if a MC stopped playing?i have a MC on my stage and I guess I have to put some event on the last frame inside the MC. now I want that code to jump to frame X of the MAIN stage- not the MC itself. how do i do this?
View 3 Replies
Feb 3, 2010
This is probably a simple thing, that I just cannot find the answer to.Basically I have designed an HTML based website.I want to incorporate a SWF element on the homepage, and am having problems doing so.In order to keep the file size of the swf I will be placing on my homepage to a minimum, I broke it down into a series of shorter scenes, that I plan on dynamically loading into my main file (which will hold all the AS) that will be placed on my site.
This is where I run into the problem.I have no trouble getting the first swf to load into my main file, but what I need to do is get the next swf to load and play after the first is done playing. So I am assuming I will need to find a script to unload the first movie, then load the second, and so on.Im actually not even sure if this is the right way to go about doing this.
View 1 Replies
Dec 1, 2010
I'm trying to build a scene in which multiple instances of the same mc start at different intervals and continue to restart over and over again at different intervals. I'm trying to get the mc to start anywhere from 3 to 10 seconds after it last stopped. I used this as3 code inside th mc itself.
var randNum:Number;
randNum = Math.round(Math.random() *5 + 2*1000);
trace(randNum);
var timer:Timer = new Timer(randNum);
[code]...
The trace shows a random number is generated but it doesn't seem to effect the interval of the timer after the first run through. "Hello" shows up in the output window every second after the randNum is traced regardless of the randNum's value.
I've tried using timer.reset but that seems to do nothing at all or stops the repeat. Probably because I don't understand how to use either '.reset' or '.delay'. I looked them up in the documentation and still don't get how they are used or even if they are appropriate to this situation. Obviously, a lot I do not understand about as3.
View 6 Replies
May 3, 2011
I embedded that (as a swf) in Captivate5 and published.It was working fine.... When I went into it today to modify some of the text it quit working. After long struggles and thne restoring the original version. I discovered that the original version was no longer working either. So sometime in the last couple of weeks this Flash AS3 file contained in Captivate5 has stopped working. The print function now produces a page that has a light gray box the size of the bounding rectangle of what is supposed to be the content (which is almost entirely text) The rest of the piece works fine and the printing function is as basic as it gets. All of what I am trying to print is contained in a single frame of a one frame movie clip:
function doPrintReport() { var myPrintJob:PrintJob = new PrintJob(); if (!myPrintJob.start()) { //printing canceled return; }else{ myPrintJob.addPage(this.report_mc); myPrintJob.send(); }}
And this was working just fine... a couple of weeks ago - Back on April 14th to be precise. This is currently living on my local IIS server on my Windows 7 64bit desktop. I have tried running it in Windows IE 8 and Firefox 3.6 - Again the original version was working and now is not.
View 1 Replies
Mar 1, 2012
I have a flash app and I need to detect whether the streaming of data has stopped.
That means the connecton is still opened but the stream of data is cut of i.e no data in the pipe.
So I am asking which of these NetStatus events coresponds to this case?
NetStatus events from here [URL]
I have used the "NetStream.Play.Complete" event but it doesnt work i.e doesnt detect this event
View 1 Replies
Apr 24, 2011
I'm fairly competent with AS2, and I've been using it to code an interface with in flash CS5 (I know, I need to embrace the AS3, but I don't have the time right now).Anyway, I hit a little snag. I've got a video container symbol, inside which there is a video player, which is animated with a fade in/ fade out animation on the frames of the video container. On the first frame of this symbol there is a "stop();".What I want to be able to do is use different buttons in different symbols and frames around the flash file to set variables, which the video container can then read and fade in appropriately.
I've already got the buttons to set the variables I want it to. Each button will set the contentPath of the actual flvplayer, and set a "vp" variable to 1(_global variable). In the video container's first frame, I've told it to gotoAndPlay frame 2 when _global.vp == 1 - However, the video container won't read the vp variable when it's been stopped.So what am I doing wrong? how am I supposed to get the video to fade in on the click of a button, which will also set the contentPath of the video?
View 7 Replies
Oct 11, 2004
i am having trouble with my gotoAndPlay in my MC.i have An MC1 on main stage then inside it i have another MC2. Now on my MC1 i want wen it comes to frame 15 to go and play starting frame2 on MC2,so in MC1 frame 15 i put mc2.gotoAndPlay(2);But nothing happens.Oh yea MC1 has stop on the first frame.
View 2 Replies
Nov 2, 2004
I followed the tutorial about gravity, with bouncing, and I wanted to figure out how to test when it has stopped bouncing.
What I am trying to get at is say I had the objet bounce from a point, then when it has stopped bouncing, move left or right. Think of a person dropped from a plane with a parachute. He has to wait until he is firmly on the ground before he can start moving...thats what I want to do.
View 1 Replies
May 3, 2003
I'm making a slots... but i have a prob. If a stop my movie, I can't know on which frame my movie is stopped. Is there a syntax-code to give me the number of the frame a that moment?
View 5 Replies
May 2, 2007
Is there a simple way to check all tweens are complete? The tweens kicked off in the code below work great, but I have another sequence that needs to kick off only when all tweens are done.Alternatively, is there are smart way to time things to execute only after X number of seconds without having to attach code to the root onEnterFrame?[code]
View 3 Replies
Aug 7, 2009
if i press right/left, he goes to the movement frame. i want him to go to the stopped frame when no key is down, but the frame shows him facing right.how can i make it 'remember' his direction?
View 1 Replies
Sep 14, 2009
I have two scenes, my first scene is a intro animation with a enter button at the end, and my second scene is my website, my website worked fine until i added the scene in before it and now it dosent work?
View 2 Replies