FlipTransition raises "Removed from Stage Event" on new view

hello,
I Have a problem with a fliptransistion. If I use this transition in my main view to go to a "settings" view. The "removed from stage" event is raised for the settings view (yes the settings view).
So first the "initialize" of the settings view is executed. In this initialize I hook up some event listeners.
Than the "removed from stage" of the settings view is executed. In this function I remove the event listeners (I think this is a good thing to do).
Than the "removed from stage" of the settings view is executed again
So the event listeners never work.
The code for the transition is nothing special I think
var ftrans:FlipViewTransition = new FlipViewTransition();
ftrans.duration =1000;
navigator.pushView(SettingsView, data, null, ftrans);
When I use the default transition "navigator.pushView(SettingsView, data)" the problem does not occur.
Anybody an idea as to how to solve this (I'd prefer to keep the fliptransition, as the default slide transition is used in another part the application, and the flip indicates to the user that he is doing something different).
Update: I've tried to move the event listeners to the "added-to-stage" phase but this doesn't quite solve the problem the events that occur on the SettingsView are: (in that order!)
- Added To Stage
- Initialize (this is bizar the view is added to stage even before it is initialized).
- Removed From Stage
- Added To Stage
- Removed From Stage
- Added To Stage
Message was edited by: NilsTT

The FlipViewTransition effect does some reparenting internally to accomplish the 3D effect.  As a result you receive multiple add and remove events.  To work around this, I would recommend using FlexEvent.ADD and FlexEvent.REMOVE instead of addedToStage.  You can also try using ViewNavigatorEvent.REMOVING.
Chiedo

Similar Messages

  • ADDED event in document class after removed from Stage

    Hi All,
    I am currently play with the document class (the class acts as main) constructor for a SWF file.
    package {
      import flash.display.*;
      import flash.events.*;
      public class TestSymbol extends MovieClip
        public function TestSymbol()
          this.addEventListener(Event.ADDED, function(event:Event) { trace(event.eventPhase, event.target, event.currentTarget, "added triggered"); });
          trace("parent", this.parent);
          this.stage.removeChild(this);
          trace("stage", this.stage);
    In frame script 1, i put
    trace("1");
    trace("parent", this.parent);
    After i run TestSymbol.swf and  i got
    parent [object Stage]
    stage null
    2 [object TestSymbol] [object TestSymbol] added triggered
    1
    parent null
    I wonder where is this ADDED event coming from? If the document class is added to some other objects, why its parent is null after the event?
    Thanks in advance
    Sam

    By wrapper do you mean they are the same object or the MainTimeLine is a separate object being added to DocumentClass, as it triggers the ADDED event? I know that framescript can be accessed as documentClass functions, so I thought they are the same object, maybe i was wrong.
    I did a new test within some more listeners
    package {
      import flash.display.*;
      import flash.events.*;
      public class TestSymbol extends MovieClip
        public function TestSymbol()
          this.addEventListener(Event.ADDED_TO_STAGE, addedToStageListener);
          this.addEventListener(Event.ADDED, addedListener)
          this.addEventListener(Event.REMOVED_FROM_STAGE, removedFromStageListener);
          this.addEventListener(Event.REMOVED, removedListener);
          trace("parent", this.parent);
          this.stage.removeChild(this);
          trace("stage", this.stage);
         private function addedListener(event:Event):void {
           trace(event.eventPhase, event.target, event.currentTarget, "added triggered");
         private function addedToStageListener(event:Event):void {
           trace(event.eventPhase, event.target, event.currentTarget, "addedToStage triggered");
         private function removedListener(event:Event):void {
           trace(event.eventPhase, event.target, event.currentTarget, "removed triggered");
         private function removedFromStageListener(event:Event):void {
           trace(event.eventPhase, event.target, event.currentTarget, "removedFromStage triggered");
    and this is the output
    parent [object Stage]
    2 [object TestSymbol] [object TestSymbol] removed triggered
    2 [object TestSymbol] [object TestSymbol] removedFromStage triggered
    stage null
    2 [object TestSymbol] [object TestSymbol] added triggered
    As the remove listeners are fired immediately, i don't think the queue is waiting until the end of the constructor.

  • RemoveEventListener when Removed From Stage?

    I am sorry if this is a truly basic question, but how would I code as3 to remove an event listener when the current frame (in my case, section of my site) is no longer on the stage?
    Take the following code as an example:
         function onClick(event:MouseEvent):void
              doSomething();
         mc1.addEventListener(MouseEvent.CLICK, onClick);
         mc2.addEventListener(MouseEvent.CLICK, onClick);
         mc3.addEventListener(MouseEvent.CLICK, onClick);
    How would I remove these event listeners when the user navigates away from this section of the site?  Being limited in my knowledge of as3, all I can come up with is:
         function removeListeners(event:Event):void
              mc1.removeEventListener(MouseEvent.CLICK, onClick);
              mc2.removeEventListener(MouseEvent.CLICK, onClick);
              mc3.removeEventListener(MouseEvent.CLICK, onClick);
         parent_mc.addEventListener(Event.REMOVED_FROM_STAGE, removeListeners);
         //where "parent_mc" is the main timeline of the current website section
    Obviously, this is not the correct solution, because it makes no sense to add an event listener just to remove some others.  In regards to best practices, how do I remove event listeners when the "section" in which they are utilized is no longer on the stage?

    use:
         function onClick(event:MouseEvent):void
              doSomething();
         mc1.addEventListener(MouseEvent.CLICK, onClick);
         mc2.addEventListener(MouseEvent.CLICK, onClick);
         mc3.addEventListener(MouseEvent.CLICK, onClick);
         function removeListeners(event:Event):void
              mc1.removeEventListener(MouseEvent.CLICK, onClick);
              mc2.removeEventListener(MouseEvent.CLICK, onClick);
              mc3.removeEventListener(MouseEvent.CLICK, onClick);
    parent_mc.removeEventListener(Event.REMOVED_FROM_STAGE,removeListeners);
    mc1=null;
    mc2=null;
    mc3=null;
         parent_mc.addEventListener(Event.REMOVED_FROM_STAGE, removeListeners);

  • Enemies not being removed from stage when clicked on with mouse.

    I have ran into another problem, I have written the code for when I click on an enemy, it doesnt add a point to the score and it doesn't remove the enemy, I have a textfield which is called messageDisplay which is linked to the clickEnemy function.
    Here is the piece of code.
    stage.addEventListener(MouseEvent.CLICK, clickEnemy);
                    function clickEnemy(event:MouseEvent):void
                    if(cursor.hitTestObject(enemyAppear))
                            score++
                            messageDisplay.text = String(score);
                            enemyAppear.parent.removeChild(enemyAppear);
                    stage.removeEventListener(MouseEvent.CLICK, clickEnemy);
    Any help is appreciated, thanks Casey.

    After double checking my code I have resolved the issue myself thanks

  • Sound from video plays after video player removed from stage

    I have a website http://www.droolpigs.com when I go there if I click the video archives button then play a video  then click on the home or photos button or one of the alternate  background buttons on the left the video goes away as it should but not  always the audio (especially when I click while the video is still  buffering).  Is there a command I can use to kill the sound from the  flvPlayback component and nothing else(I have a mp3 player there also I  so I don't want to use the SoundMatrix class.
    btw the videos are all played on an instance of the flvPlayback component.

    That didn't work.  I found this posting where someone claimed to access the netstream object in flvPlayback
    video1.addEventListener(VideoEvent.STATE_CHANGE, onVideoStateChange);
            private function onVideoStateChange(evt:VideoEvent)
                ns = evt.target.getVideoPlayer(evt.vp).netStream;
                video1.removeEventListener(VideoEvent.STATE_CHANGE, onVideoStateChange);
                setNetstreamObject();        
    I attempted to instantiate ns this way var ns:NetStream = new NetStream(); but the compiler was expecting a argument.
    I'm about ready to ditch flvPlayback and try my luck with the NetStream class.

  • Flagged photos from events were removed from events and placed in a flagged folder

    Hi,
    I have created several events in iphoto, flagging my favorite pictures.  The pictures used to show up in each event with a flag in the corner of the picture.  Now they have been removed from the events they were in and put in a "flagged" folder on the left column.  Does anyone know why this happened?
    Thanks

    Make sure wern't accidently hidden at the same time they were flagged.
    OT

  • MovieClip disappears from stage when printing

    Hi,
    I am printing a parent moviclip which is on stage and has many child movieClips with linked classes having all single frames.When I try to print by passing it to printObject which is in external class few things happend as:
    1. the object is printed but moviclip is removed from stage
    2. also the dynamic text labels are not printed
    3.the size is smaller than the original.
    how to get to resovle these issues to obtain good print out from flash cs5 using AS
    Any help is appreciated
    srini

    the only way i know to obtain pixel-perfect printing is to instantiate your printjob and using its pageWidth and pageHeight properties, (re)construct the pages you want printed, print and finally ready the no-longer-needed newly constructed pages for gc.

  • Remove from page menu option in personalization

    Hi All,
    After clicking the Personalize link am getting new window Portal  lagunage option in the detail navigation.
    In the Page menu there are different option like remove from page, open in new window. I have selected remove from page  option and afte that whole contect area became blank.
    I want to revert the changes but am not able to do the same, because i am getting nothing in the content area, only in the detail navigation i am getting one link as Portal  lagunage. After clicking this link also am not getting any thing.
    I want to get back the language change page. i got one thread on the same but anot able to revert the changes done by me. ESS - Personilize - urgent
    Please provide solution for the issue.
    Deepak!!!

    Use the System Admin role to revert it back.
    There is a under System Admin> Support > > Portal Content Directory > Personalisation cleanup
    the required tool.
    Use Principal and enter the user.
    Regards,
    Kai

  • Hi, How to stop the open new view when i click button in OnClick event

    Hi,
    I have the popup window[window.showodelDialog] with one button called confirm.and table control values
    Actual requirement: when i click confirm button it saves the tablecontrol value in the internal table. it is fine.It saves.
    Currently working is : When i click the confirm button in the onClick event ,the new view is opening with empty tablecontrol popupin the new window.I don't want that one.
    my requirement is: When i click the confirm button through onclick event ,i want to close the currently showing popupwindow and it should come to main page.How to do that?
    view1.htm
    =======
       <htmlb:button id            = "sub1"
            onClick =""
            text          = "Confirm" />
    Do_handle_data
    ============
      LOOP AT lt_form_fields INTO lw_form_field WHERE name CS
                                              't_confirm' .
        CALL METHOD /ds1/cl_mdm_tablecontrol=>populate_table(
                       EXPORTING
                         im_id      = 't_confirm'
                         im_request = me->request
                       CHANGING
                       ch_table   = me->r_asset_data->t_maintain ).
        EXIT.
        ENDLOOP.
    t_maintain it stores the changed values.. It is fine..

    Hi raja,
    1.I have a main page like req_asset_create.htm. In this page one button called maintain. If i click the maintain button the popup window is opening using window.showModelDialog. 
    2. In this popup i have a Editable tableview and one button called confirm. User can edit the values. After editing he is clicking the confirm button.
    3.when he click the confirm button two things should happen a)Popup should vanish and it should go to main page ie req_asset_create.htm.The editrd values should store in to the internal table (t_maintain).it is in model class.
    What heppenings for me using this code
    =============================
    <%----
    confirm -
    --%>
        <htmlb:button id            = "con"
            onClientClick = "self.close();"
            text          = "confirm"
            onClick       = "confirm"/>
    When i click the confirm button ->popup is closing ->thats 100% fine and again one new view is coming with popupdisplay values.This should not happen.
    a)The server event is not happening.It should happen.
    b) The edited values are not stored in the internal table..
    Do_handle_data : for storing the edited tableview values
    ===========   
    confirm
      LOOP AT lt_form_fields INTO lw_form_field WHERE name CS
                                              'con' .
        CALL METHOD /ds1/cl_mdm_tablecontrol=>populate_table(
                       EXPORTING
                         im_id      = 'tv1'
                         im_request = me->request
                       CHANGING
                       ch_table   = me->r_asset_data->t_maintain ).
        EXIT.
        ENDLOOP.
    What should i do to happen for the server event to update the edited records.
    How can i achieve? ow to control the new opening view?

  • Raise a button's click event handler from another event handler

    hi,
    I am trying to raise a button's click event from another button's click event.
    Automation gives a runtime error. I checked out some other forums for answers but they dont work when called from another event handler.
    Console.WriteLine(gestureData.name);
    if (s==b2) ;
    //raise button2's click event
    private void b2_Click(object sender, RoutedEventArgs e)
    MessageBox.Show("I am button2");
    private void b3_Click(object sender, RoutedEventArgs e)
    MessageBox.Show("I am button3");
    Any help will be appreciated.
    Thanks,
    Shaleen
    TheHexLord

    Hi Andy,
    I tried to implement your suggestion.
    What I am trying to do is, say there is a label whose content property needs to be updated every time a button b1 is clicked. When the button is clicked , it check if a condition is met and depending upon that condition it updates the content of the label
    . Say , if the text entered is "add" and the button is clicked and the label's content is set to "add", if the text entered is "sub" and then the button is clicked, the label's content is set to "sub".
    I understand that there is no need to fire up different methods for this as this can be done by checking for conditions in the same button click event but it seems that updating the UI is not happening. I get an error saying.:
    A first chance exception of type 'System.InvalidOperationException' occurred in WindowsBase.dll
    The program '[6660] WpfApplication8.vshost.exe: Program Trace' has exited with code 0 (0x0).
    The program '[6660] WpfApplication8.vshost.exe: Managed (v4.0.30319)' has exited with code -1073741819 (0xc0000005) 'Access violation'.
    this goes away when I remove the Label.Content="add" or Label.Content= "sub";
    I think the label's content property does not update dynamically.
    Thanks
    TheHexLord

  • [svn:fx-trunk] 10826: When a Video is removed from the stage or becomes invisible, the video will now pause playback.

    Revision: 10826
    Author:   [email protected]
    Date:     2009-10-02 10:28:43 -0700 (Fri, 02 Oct 2009)
    Log Message:
    When a Video is removed from the stage or becomes invisible, the video will now pause playback.  This features is controlled through a new property, playWhenHidden, which defaults to false (meaning we don't play the video when it's hidden).  When it becomes visible/on-stage again, we will start playing the video if autoPlay=true.  Otherwise, the video will not automatically start playback.
    This property still needs to be reviewed by PARB.
    Also, updating a comment in SkinnableContainer relating to a FIXME I own.
    QE notes: -
    Doc notes: -
    Bugs: SDK-21928
    Reviewer: Deepa
    Tests run: checkintests, mustella VideoElement/VideoPlayer
    Is noteworthy for integration: Yes
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-21928
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/SkinnableContainer.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VideoPlayer.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/VideoElement.as

    Is this the same trouble you are having?
    http://discussions.apple.com/thread.jspa?threadID=826805&tstart=0
    DP G5 2GHz    

  • Apple Ipad has been factory reset and removed from manage devices but the new user can't register it under a new ID

    iPad generation 2 has been factory reset, removed from managed devices, apple support, and the device still continues to say it's locked by my ID and cannot be unlocked and registered to a new ID.
    HELP!

    Even if you are sure you have done all of this, do it again slowly and in the order given:
    Prepare your device to sell or give away
    If there is still a problem, post back with the exact complete wording of the error message
    received.

  • HT5129 I had photos from MobileMe organized into different events.  When iPhoto made a MobileMe event, it took all of those photos out of the other events and put them all together in the new "from MobileMe" event.  Is there any way to reverse this?

    I had photos from MobileMe organized into different events.  When iPhoto made a MobileMe event (when MobileMe ended), it took all of those photos out of the other events and put them all together in the new "from MobileMe" event.  Is there any way to reverse this?

    Only to load your backup from before downloading the MM photos
    LN

  • Is there a way to automatically remove URL's from iCal events?

    Is there a script or any easy way to remove URL's from iCal events? I like to print my daily calendar to insert into a small day planner but I have very long URL's wasting up space.

    For dealing with duplicates in iPhoto check out Duplicate Annihilator
    Regards
    TD

  • HT2513 I can't delete events recurring annually...not part of birthday calendar, one's I've added manually.  I've tried delete key, cut event, changing to no recurrence, they just revert to original recurrence and will not be removed from my calendar.  Th

    I can't delete events recurring annually...not part of birthday calendar, these are events I've added manually.  I've tried delete key, cut event, changing to no recurrence, they just revert to original recurrence and will not be removed from my calendar.  Events that occur weekly I'm able to delete, this is only happening with events recurring annually.  Very frustrating.  Thanks for any ideas.

    If you are using a PC, log on to iCloud using Safari (rather than Explorer) to reset the photostream. Then turn iPhone/iPad photostream off and back on. I was getting the same server error as you and this advice from another blog worked for my iPhone and iPad.  But I still can't get photostream deleted from my apple tv. There does not seem to be a photostream on/off control In Apple tv 4.4 software.  I tried switching the screen saver to one of the ones that comes preloaded on the device, then back to photostream but all the old photos are still there.  If anyone can help with this, I would appreciate it.

Maybe you are looking for

  • ITunes does not open and gives no error message on Vista

    Hello, I have an iPhone 4 on Windows Vista and haven't really had any problems until recently. Nothing has changed (that I am aware of) on my Vista machine but now, iTunes won't start and I am not getting any error message. It just brings up a messag

  • Interproject relationships in P6

    I am a relatively new P6 user; I have a problem I cannot solve. I want to view interproject relationships (predecessors and successors) either: --in the tabular view in P6, --exported to Excel, or --in a report. I suspect the tabular view within P6 i

  • How do you add a signature to your forum posts?

    How do you add a signature to your forum posts?  I went here, but no information available on "how" to set up a signature. http://forum.verizon.com/t5/Terms-of-Service-and-User/Verizon-Community-Signature-Guidelines/m-p/212... If you are the original

  • Normal phone numbers are not being recognized as v...

    I don't understand why, but everytime I try to skype numbers I've skyped before and other numbers like customer service to sprint, etc i get a notice that says this is not a valid skype name or number... My skype number is from the US but I'm in Arge

  • Music Folder 100% CPU Usage

    Whenever I open my music folder in my Windows 8 lenovo x220 Laptop my CPU rises to 100% usage ( not temporary) , untill I restart the explorer.exe proccess Please support ty