IGE.graphic dispatches Event.REMOVED_FROM_STAGE events after each updatecomplete event

When I type in TLFtextField dispatches RemovedFromStage events after each word! Why?
var em:EditManager= new EditManager()
em=txt.textFlow.interactionManager as EditManager
var MC:mc=new mc()
MC.addEventListener(Event.REMOVED_FROM_STAGE,rs)
txt.textFlow.addEventListener(StatusChangeEvent.INLINE_GRAPHIC_STATUS_CHANGE,u)
em.insertInlineGraphic(MC,"auto","auto")
function u(e:StatusChangeEvent):void{
      if(e.status==InlineGraphicElementStatus.READY ||e.status==InlineGraphicElementStatus.SIZE_PENDING){
           txt.textFlow.flowComposer.updateAllControllers()
           if(e.status=="ready")txt.textFlow.removeEventListener(StatusChangeEvent.INLINE_GRAPHIC_ST ATUS_CHANGE,u)
function rs(e:Event):void{
trace(e.type)

Thank you Richard
This happens only if I set the IGE.float to none. Is there any other way
to know if an IGE is removed from stage(user deletes it for e.g.)?
Now my code is something like this:
var em:EditManager= new EditManager()
txt.textFlow.interactionManager=em
em.textFlow.addEventListener(StatusChangeEvent.INLINE_GRAPHIC_STATUS_CHANGE,statusChanged)
file.addEventListener(Event.SELECT,graphicSelected)
function graphicSelected(e:Event){
  var flv:FLVPlayback= new FLVPlayback();
  flv.skin = "/SkinOverAllNoCaption.swf";
  flv.autoPlay = false;
  flv.source = new URLRequest(file.nativePath).url;//"C:/Users/Dell/Desktop/flv.f4v" for example
  flv.addEventListener(Event.REMOVED_FROM_STAGE,removeHandler);
  em.insertInlineGraphic(flv,"auto","auto""none", new SelectionState(txt.textFlow,0,0))     
  em.textFlow.flowComposer.updateAllControllers()
function statusChanged(e:StatusChangeEvent):void
trace(e.status)
if(e.status==InlineGraphicElementStatus.READY ||e.status==InlineGraphicElementStatus.SIZE_PENDING){
  em.textFlow.flowComposer.updateAllControllers()
  if(e.status==InlineGraphicElementStatus.READY){
      txt.textFlow.removeEventListener(StatusChangeEvent.INLINE_GRAPHIC_STATUS_CHANGE,statusCha nged)
  gr.id=file.name//"flv.f4v" for example
function removeHandler(e:Event):void
if (e.currentTarget as FLVPlayback)
  var flv:FLVPlayback = e.currentTarget as FLVPlayback;
  ID=flv.source.substr(flv.source.lastIndexOf("/")+1)
  if (! em.textFlow.getElementByID(ID))
  var vp:VideoPlayer = flv.getVideoPlayer(0);
  vp.close();
  trace("REMOVED : "+ID); 
  currentGraphic=null
else if(e.currentTarget as Loader){
  currentGraphic=null
But the problem is the removeHandler function will check for existance of ALL IGEs with float set to
none after typing each word, right?
BTW Sorry for my bad English!

Similar Messages

  • Questions on Dispatching events

    Hey all,
    I have been trying to get a grasp on dispatching events and have a few questions I am hoping you will all be nice enough to clearify for me.
    Do I have to have a custom Event class to dispatch a custom event?
    If so do I have to create a new intance of the event each time I want to dispatch an event. Example:
    dispatchEvent(new MyEvent(MyEvent.TASK_COMPLETE));
    or can I just dispatch an event once an instance has already previously been created.... example:  dispatchEvent(MyEvent.TASK_COMPLET);?
    Thanks,

    hi
    if you dont need to pass any data along with the event then you dont need a custom event, you can just use a custom event name. eg: dispatchEvent(new Event("myEventName"));
    if you want to dispatch the same event multiple times, you can (but not sure why you would want to do that?), eg:
    var e:Event = new Event("myEventName");  [or new MyCustomEvent("myCustomEventName", myCustomData) ]
    dispatchEvent(e);
    dispatchEvent(e);
    dispatchEvent(e);
    dispatchEvent(e);
    dispatchEvent(e);
    dispatchEvent(e);

  • [Embed(source="...   And dispatching events and trace commands not working

    Hi,
    I have a main swf that Embeds another swf.  In the embedded (child) swf I have trace commands and it dispatches events. 
    I embed the child swf like this:
    [Embed(source="../assets/child.swf", symbol="ChildMC")]
    public var ChildMC:Class;
    var child_mc = new ChildMC();
    child_mc.addEventListener(Event.COMPLETE, childComplete);
    addChild(child_mc);
    function childComplete(event:Event):void
    at the end of the timeline in the child swf I have: dispatchEvent(new Event(Event.COMPLETE));
    When I test the main swf, I can see the child swf, but the main swf can't catch any of the dispatched events and I don't get any trace commands from the child swf.
    How can I catch events from an embedded swf?
    thanks!

    I did a quick sample with two fla's.
    The first loads in a child swf and then calls a funtion on the main timeline:
    var url:String = "loadTestChild.swf";
    var urlRequest:URLRequest = new URLRequest(url);
    var loader:Loader = new Loader();
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loader_complete);
    loader.load(urlRequest);
    addChild(loader);
    function loader_complete(evt:Event):void {
       evt.currentTarget.content.callMeFromParent();
    The child swf has this code on the main timeline:
    function callMeFromParent ():void {
              trace ("called from parent whoop");
    Running the parent, the trace is called.
    So with this you should be able to call any function you have in the child from the parent.

  • On-dispatch-event trigger related to mscomm (load weight from weight scale

    aoa!
    please guide me to pick weight from weight scale.
    i m using mscomm32 ocx for this purpose.
    clarify the role of on-dispatch-event trigger and specify all events
    regarding mscomm and also explain how to trap events for accomplish
    task.
    thanks in advance.
    Tool used:developer 6i & oracle 10g windows xp(sp2)professional.

    Thanks, but I've already seen this thread and done the steps described on it.
    Actually, my question is very specific... How to populate the fields LinkVal and LinkUnit of the registry...
    I read all the threads here in SDN and they don't answer my question...
    I'd be glad if someone had already done tcode HUPAST works for Filizola...
    Tks again.

  • Dispatching events from JNI

    I've got an application that is trying to watch for mouse events anywhere and everywhere. The goal is to be in-the-know when there is mouse activity going on in general, with the Java app running in the taskbar.
    I have determined that I'll likely need JNI to accomplish this, as paying attention to mouse activity over the whole operating system is somewhat operating system dependent. : )
    Nevertheless, I'd like Java code to handle the events, and I can't seem to find any way for JNI to dispatch events back to the Java side of things. My hope was to catch the events thrown by the system in C/C++ and then simply dispatch them again to act as a middle-man.
    If anybody can tell me how I might accomplish this using JNI, or even a step in the right direction, I would greatly appreciate it. Or, if I'm barking up the wrong tree, please please let me know.
    Thanks,
    - J

    Steps in order
    1. Determine how to capture the events in C/C++. There is no java in this step.
    2. Write an API in C/C++ that models the functionality that you want to use in java. There is no java in this step.
    3. Write java/jni that uses the API in 2. There is java in this step.
    As a callback you will need to use the jni attach thread method.
    You better be careful as messing up on any of the steps above can render your mouse inoperable for the entire OS, so learn the keyboard shortcuts.
    I think that someone posted code like this in the past. I could be mistaken however.

  • Dispatching event from Javascript

    Can I dispatch events from javascript to flash player? I am trying to do so by calling dispatchEvent() on flash player dom object but the event is not passing inside flash player. Any links or clue?

    To be specific ... I can catch a right click and supress it. But I want to send it to flash (lets say) as a left click. Problem is when i do that, javascript listner for dom element will get fired for left click but there wont be any events in flash.
    SO the question is can i fire events on flash from outseide or is it outside the public APIs?

  • Dispatching events between different classes

    Im trying to dispatch and event from an XML class.
    dispatchEvent(new Event (XMLClass.INDEX_CHANGED));
    and catch it in the display class
    import AS.XMLClass;
    private var _xml  = new XMLClass();
    _xml.addEventListener(XMLClass.XML_LOADED, swapImage);
    I know that im missing something because the application works
    and the function runs but its not dispatching the event the event
    or maybe it's not catching the event in the display class, even though everything else is working
    and im not gettin' any errors.

    that's exactly what i did.
    i have 3 classes
    AS.XMLClass
    AS.ControlClass
    AS.DisplayClass
    It's like a slideshow thing.
    I have a button on stage thats connected to the control class and every time you press it
    it changes the index of the image in the xmlclass and everytime that the index is changed the xmlclass needs to
    dispatch and event that the index has changed and the display class is going to catch the event and change the image
    everything is working except the xmlclass dispatch event or the displayclass catch event
    XMLCLASS
    public static const INDEX_CHANGED:String = "indexChanged";
    private function dataLoaded(event:Event):void{
                trace("xml file is loaded");
                data = new XML(loader.data);
                dispatchEvent(new Event(XMLClass.XML_LOADED));
                totalItems = data.images.photo.length();
                setCurrentIndex(currentIndex);
    CONTROL CLASS
    import AS.XMLClass;
    private var _xml = new XMLClass();
    public function leftButtonClicked(){
                _xml.setCurrentIndex(_xml.currentIndex = _xml.currentIndex - 1);
            public function rightButtonClicked(){
                _xml.setCurrentIndex(_xml.currentIndex = _xml.currentIndex + 1);
    DISPLAY CLASS
    import AS.XMLClass;
    private var _xml  = new XMLClass();
    _xml.addEventListener(XMLClass.XML_LOADED, swapImage);
    public function swapImage(event:Event){
                trace("working....");

  • Reading the output values after each step executes in LabVIEW User Interface

    Hello all,
    Development environment: TestStand 2010 SP1 and LabVIEW 2010 SP1
    Problem: is there a way to execute the subsequent steps programatically and get the output values from each of them?
    I have already extended a little bit a Full OI interface for TestStand to load up any sequence, choose some of the steps and run them step by step (something like option to Run Selected steps). What I am trying to do is to add some actions between each step and do that in User Interface (I can't modify the sequence!), so I am starting the NewExecution with some previously configured InteractiveArgsParam and set an option breakAtFirstStep to True. Afterwards I am just doing something like Step Over when debugging the sequence and this works good, but I didn't fine a way yet to read the output values from the steps...
    Then, if I wait until the execution finishes I can read my Results by processing the ResultObject, but this works only after finalizing of the test sequence. Since I wanted to stop after each step, read the values, do some actions and continue to the next step I tried to register an event callback for Trace of Execution View Manager. I can see that after each executed step this event is triggered, but when I try to read a ResultObject returned in Event Data it is not filled with values (ResultList seems to be empty?). Is it a proper behaviour or maybe I am doing the readout in wrong way? (It is the same VI as for reading ResultObjects after sequence finishes and there it works fine for arrays, containers and other data types).
    Like I mentioned I can't modify the Test sequences, I can't add a UImessages.
    What are my options? Should the trace event returns all output values from each steps or is it just used for status checking? Or maybe there is completely different approach to that matter?
    Thanks in advance for any suggestions,
    Best Regards.
    CLA, CTD, CLED @ Test & Measurements Solutions Poland
    Solved!
    Go to Solution.

    Thanks for your replay, I have tried to build it in my LabView Block Diagramm, es seems like this image.
    But the variable GetNumSubProperties ist always 0. Why?
    PS: I need only the variable "Step.Result.PassFail" from the last step, do you know, how can I get it? I think, it is maybe easier than read all the "Result".
    Attachments:
    ReadStepResultInLabview.JPG ‏39 KB

  • Add a button after each node of my tree

    Hi !
    I would like to add a button after each node of my tree. I think I have to create a new TreeCelleRenderer but I really don't know how to make it. Can someone help me and give me an idea (or an example !) about the code.
    When I click the button, I must know from which node the event comes.
    thanks.
    delph

    Hi, how did you resolve the problem. Well it's long time from your posting, but maybe someone else can help me...
    I'm creating similar JTree where's print and save buttons in some of the nodes. I created custom cell renderer which extends JPanel and holds images, text and the buttons inside it. Is it possible to link buttons' actionlisteners somehow to the nodes. I tried it customizing cell editor, but I can't get button events fired. I also tried to catch "button clicked" action using mouse listener in my tree and that worked somehow and can be used as quick and dirty solution. Still I want to do it better way.
    -e

  • Stopping tracks after each play

    I broadcast athletic events and I'm using iTunes to play clips from ID's, to interviews and highlights. Is there any way in iTunes to get each item to stop after each play....so that it wont automatically go onto the next track?
    Thanks!
    Scott

    Also, if you type in the title of the track at the top where it says "search," as long as there's nothing with too similar of a title, it will show only that one track that you typed in, and it will stop when it's over. It's almost like making a temporary playlist of the items containing only your search terms. That's what I do because I have far too many tracks to check/uncheck them each time I want/don't want one to play.

  • End jump after each chapter

    I have DSP 4.2.0
    I want the DVD to jump back to the menu page after each chapter is finished.
    Can someone direct me on how to do this? I tried under "connections" setting it up, but it didn't work.
    Gerry

    First off, there are three different layouts that you can use for DVDSP. The vast majority of people use the 'Advanced' layout which gives access to all of the tools and settings. Whilst it looks daunting, I recommend you switch to it. That way, you'll be seeing it the way others see it, and the instructions will make more sense to you.
    You can add commands to lots of elements in your project. If you have a single video in your timeline and have put chapter markers along it, you can set an 'end jump' on each chapter marker by simply clicking on the marker once and looking in the property inspector for the 'end jump' setting. Use this to set each to go back to the main menu when it has played through.
    However, this will not be the most reliable way to get this done. It will work on some players, but users will be able to skip through the track and bypass the end jumps. You can prevent this if you want, but an easier and more robust way to achieve this is to use stories.
    If you look on the top bar of the app you'll see icons that enable you to add new elements to your project. Adding a story is as simple as clicking on the story icon.
    A story is a container for chapters, and works like a play list in iTunes. You can add one or more chapters to the story, but in your case you only want to add one per story. Stories are also elements in your project and they can have end jumps on them. You add a story, and then in the story tab drag a single chapter from the list of chapters into the story container. You repeat this for every story you need. Then set the end jumps for the stories - click on a story in the outline view tab or graphical view and look in the property inspector... set the end jump for each story to go back to your menu.
    The buttons on the menu now need to have the story container as the target and NOT the chapter inside them. This is crucial.
    If you do this correctly it will work as you want it to, with just a single chapter playing and then the disc sending the viewer back to the menu.

  • How to make videos automatically play right after each other?

    I have four videos that I need to automatically play right after each other. For instance video1 plays and is done so video 2 should automatically start to play and then when video 2 is done video 3 should start and when video 3 is done video 4 should start and when video 4 is done video 1 should start. How do you code for this? Also, when a button is clicked whatever video is playing needs to stop and then the item that the button is linked to should show up whether it is another video or a graphic with scrolling text.

    How do you use a complete listener? Can you give me an example of code to use or give me a link that has step-by-step instructions? I really would appreciate it.

  • Print HTML Report Automatica​lly after Each UUT

    Hello
    I saw the document on NI site called "Print HTML Report Automatically after Each UUT". That's exactly what I want to do with XML files. So I put it in my sequence file and it works fine, but when it opens the xml file at the first step, there's a pop-up from IE who say that "Scripts are generally safe, do you want to authorise this script" (This message is also displayed when I open my file in files explorer).
    So, the print is not automatically anymore as I must answer to this pop-up. does anybody has a solution to bypass this pop-up ?
    I tried to use the property silent on the class IWebBrowser2. Inded, the pop-up doesn't appear anymore, but my XML file isn't correctly printed. I supposed the default response of the pop-up (which is no) is applied. So the script isn't executed.
    I also tried to configure IE to not display this pop-up : No result
    Regards
    Laurent

    Hello,
    I think that you need to configure your browser, can you take a look a this article:
    http://www.maxi-pedia.com/scripts+are+usually+safe​+do+you+want+to+allow+scripts+to+run
    Regards,
    Nacer M. | Certified LabVIEW Architecte

  • Spotlight index lost after each login

    Hello people,
    I've got a very confusing thing going on with Spotlight on my mac.
    After each login, Spotlight looses its index and I can't my files.
    I have tried solving this problem with the app IceClean, using "sudo mdutil -i on /", dragging and remvoing something into the privacy tab in Spotlight's preferences and some other tips and tricks I got from this forum, but nothing worked.
    The odd thing is, Spotlight finds the files, but only after some time. My guess it's restores the index or re-indexes everything. Yet that doesn't help since it gets deleted after the next login.
    I am very confused right now. No solution seems to work I thought maybe you guys know some answer to that problem.
    Any tip and help is greatly appreciated.
    Best regards
    Martin
    I am using a Macbook Pro, Snow Leopard v10.6.6 (10J567)

    No one?

  • Schedule line date changes after each MRP run

    Dear Experts,
    Clarification needed on how the system plans the MM schedule lines.
    Setting: Start in the past not allowed.
                  3 days for processing of order
    The issue is after each MRP run the system is moving the schedule line to the current date + 3 days for processing + the planned delivery time.
    If the schedule line is not firmed, after each MRP run ( which happens everyday) the system is moving the schedule line and then giving an alert saying the " order has to be rescheduled to the previous day"
    on the second day after the mrp run the system moves the schedule line again by one more day and gives the rescheduling date as " -2 days from today"
    this change is happening every day after the planning run. - because of this there are really no backorders ( schedule line in the past ) in the system. we were not able to know if the vendor is actually delayed in this case.
    can you kindly suggest what went wrong here ??
    we are using strategy 10 for the planning of procured parts. Let me know if more info is needed.
    Note: we are also using stock transfer process for some procured parts. there too the PR date gets changed after each MRP run. There there is no lead time in this case. the order is placed on the same day as the requirement as both plants are nearby. There the PR date is changing everyday to the current date.
    your advice would be of great help
    thanks
    Nagendra Kumar

    Hi Caetano,
    thanks for your suggestion
    Yes, we use firm zone for few of the vendors. there the system don't change the schedule lines.
    Also for the stock transfer PR's there is no firm zone and the lead time is one day. in this case it changes everyday after the MRP run.
    the stock transfer PR's leads to the creation of Schedule lines from the source plant. Since this PR gets changed everyday. the alerts coming out of MD07 gets changed and we really did not know if this order is delayed or not.  In the source plant we use the firm zone to avoid moving the schedule line. But then the alerts are always not correct.
    is there any setting which helps in not moving the PR everyday without using " start in the past"
    thanks
    Nagendra Kumar

Maybe you are looking for