Mxml file listening for event.

Hi All,
   I'm having following code in my project, here Report.mxml file displays to enter user details like (firstname,lastname,city,state,zip etc). After entering user information there is submit button. When user selects this button it needs to submit this data into database and return REPORT_ID back to confirmation state.
   My problem is that submitting data into database and getting REPORT_ID is taking some time because of that it is not displaying REPORT_ID in Confirmation viewStack. Rather than getting REPORT_ID from RemoteObject, hardcoding(given in red color) this value in my controller then it is displaying REPORT_ID.
  How to wait for event result for displaying confirmation viewStack. Can anyone please suggest me what changes I need to make so that confirmation page will be displayed only after getting REPORT_ID.
------------------------------- Report.mxml (begin) ----------------
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%">
<mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import com.westernstates.classes.controller.WesternStatesController;
    import com.westernstates.classes.model.WesternStatesModel;
    import com.westernstates.classes.events.*;
    private var _inquiryIdTxt:String;
    private var _inquiryIdTxtChanged:Boolean;
    public function set inquiryIdTxt(value:String):void
       _inquiryIdTxt = value;
       _inquiryIdTxtChanged = true;
       invalidateProperties();
       invalidateSize();
    override protected function commitProperties():void
      super.commitProperties();
      if (_inquiryIdTxtChanged)
          Alert.show("Inside commitProperties 1",_inquiryIdTxt);
         inquiryIdVal.text = _inquiryIdTxt;
         //inquiryIdVal.text = "1234"
         _inquiryIdTxtChanged = false;
    public function init():void{
        Alert.show("Inside newreport init mxml");
        myViewStack.selectedChild = newReport;
        Confirmation.visible=false;
        // Reset the value too.
        first_name.text = "";
        last_name.text = "";
        street_address.text = "";
        street_address2.text = "";
        city.text = "";
        state.text = "";
        zip.text = "";
        public function submitInquiry(evt:Event):void{
        var chk_speed_up:String = "";
        WesternStatesModel.inquiryConsumer.first_name = first_name.text;
          WesternStatesModel.inquiryConsumer.last_name = last_name.text;
          WesternStatesModel.inquiryConsumer.street_address = street_address.text;
          WesternStatesModel.inquiryConsumer.street_address2 = street_address2.text;
          WesternStatesModel.inquiryConsumer.city = city.text;
          WesternStatesModel.inquiryConsumer.state = state.text;
          WesternStatesModel.inquiryConsumer.zip = zip.text;
          myViewStack.selectedChild = Confirmation;
          newReport.visible=false;   
         this.dispatchEvent(new NewReportEvent());        
          //inquiryIdVal.text = _inquiryIdTxt;
          inquiryIdVal.text = WesternStatesModel.inquiryConsumer.inquiry_id;
    ]]>
</mx:Script>
    <mx:ViewStack id="myViewStack" width="100%" height="100%" creationPolicy="all" >
    <mx:Canvas id="newReport" height="100%" width="100%" visible="true">
    <mx:Label x="10" y="10" text="NEW REPORT"  fontSize="18" fontWeight="bold" color="#F07012"/>
    <mx:TitleWindow width="100%" height="100%" layout="absolute" title="Create A New Report" fontWeight="normal" fontSize="13" y="38" x="0">
     <mx:Canvas height="100%" width="100%">
     <mx:VBox width="100%" height="100%">
         <mx:HBox>
             <mx:Label text="Consumer Information: " fontSize="12" fontWeight="bold" color="#34B05D"/>
         </mx:HBox>
         <mx:HBox>
             <mx:Label text="Report Type: " fontWeight="normal"/>
             <mx:Label text="Phone" fontWeight="bold"/>
         </mx:HBox>
         <mx:HBox width="100%">
             <mx:Label width="25%"  text="First Name:" fontWeight="normal"/>
             <mx:TextInput width="25%" id="first_name"/>
             <mx:Label  width="25%" text="Last Name:" fontWeight="normal"/>
             <mx:TextInput width="25%" id="last_name"/>
         </mx:HBox>
         <mx:HBox width="100%">
             <mx:Label  width="25%" text="Address1: " fontWeight="normal"/>
             <mx:TextInput width="25%" id="street_address"/>
             <mx:Label  width="25%" text="Address2:" fontWeight="normal"/>
             <mx:TextInput width="25%" id="street_address2"/>
         </mx:HBox>
         <mx:HBox width="100%">
             <mx:Label  width="25%" text="City: " fontWeight="normal"/>
             <mx:TextInput width="25%" id="city"/>
             <mx:Label  width="25%" text="State:" fontWeight="normal"/>
             <mx:TextInput width="25%" id="state"/>
         </mx:HBox>
         <mx:HBox width="100%">
             <mx:Label  width="25%" text="Zipcode: " fontWeight="normal"/>
             <mx:TextInput width="25%" id="zip"/>
             <mx:Label  width="25%" text="Phone"/>
             <mx:TextInput width="25%" id="phone"/>
         </mx:HBox>
         <mx:HBox width="100%" horizontalAlign="center">
             <mx:Button label="SUBMIT REPORT" id="submit_search" click="submitInquiry(event)" fillColors="#34B05D"/>
         </mx:HBox>        
        </mx:VBox>
    </mx:Canvas>
    </mx:TitleWindow>
    </mx:Canvas>
        <mx:Canvas id="Confirmation" width="100%" height="100%">
        <mx:Label x="10" y="10" text="NEW REPORT"  fontSize="18" fontWeight="bold" color="#F07012"/>
        <mx:TitleWindow width="100%" height="132" layout="absolute" title="Create A New Report" fontWeight="normal" fontSize="13" y="38" x="0">
        <mx:VBox width="100%" height="81">
             <mx:HBox>
                 <mx:Label text="Submission Confirmation:" fontSize="12" fontWeight="bold" color="#34B05D"/>
             </mx:HBox>
             <mx:HBox>
                 <mx:Label text="Report has been created successfully with Report ID:"/>
                 <mx:Label id="inquiryIdVal" fontSize="12" fontWeight="bold" color="#34B05D"/>
             </mx:HBox>
         </mx:VBox>
        </mx:TitleWindow>
        </mx:Canvas>
    </mx:ViewStack>
</mx:Canvas>
------------------------------- Report.mxml (end)   -----------------
------------------------------- NewReportEvent.as( begin) ---------------
package com.westernstates.classes.events
  import flash.events.Event;
  // This custom event should be dispatched if the user
  // successfully logs into the application.
  public class NewReportEvent extends Event{   
    public static const REPORT:String = "report"; 
    public function NewReportEvent(){
      super(NewReportEvent.REPORT);
------------------------------- NewReportEvent.as( end)   ----------------
------------------------------- WesternStatesController.as (begin) ------------
   public class WesternStatesController extends UIComponent{
    public function WesternStatesController(){
      addEventListener( FlexEvent.CREATION_COMPLETE, init);
    // Add event listeners to the system manager so it can handle events
    // of interest bubbling up from anywhere in the application.
    private function init( event:Event ):void{    
     systemManager.addEventListener(NewReportEvent.REPORT, newInquiry, true);
      login(new LoginEvent(LoginEvent.LOGIN));
        public function newInquiry(evt:NewReportEvent):void{
             Alert.show("Inside newInquiry", evt.type);
             addNewInquiry();
             //getNewInquiryResult();
         }//End of newInquiry
         public function addNewInquiry():void
             ro = new RemoteObject();
             setUpAmfChannel();
             ro.destination = "manageInquiryService";
             ro.addEventListener("fault", faultHandler);      
             ro.createInquiry.addEventListener("result", getNewInquiryResultHandler);
             Alert.show("Before addNewInquiry");      
             ro.createInquiry(WesternStatesModel.inquiry,WesternStatesModel.inquiryConsumer);
         }//End of addNewInquiry
         public function getNewInquiryResultHandler(event:ResultEvent):void
                 WesternStatesModel.inquiryConsumer.inquiry_id = event.result as String;
                //WesternStatesModel.inquiryConsumer.inquiry_id = "09S-1234";  UNCOMMENT     
         }//End of getNewInquiryResultHandler
------------------------------- WesternStatesController.as (end) ---------------
Thanks in advance.
Regards,
Sharath.

Can someone please tell me how to add event handler to show REPORT_ID before displaying confirmation page. Confirmation page should be displayed once data saved successfully and getting REPORT_ID back from server.
How to set variables for .mxml from action script(.as) file.
Thanks,
Sharath.

Similar Messages

  • Listen for Events from anywhere

    Hello!
    I have an application with a rather complicated component hierarchy.
    How can I have it so that I can listen for events from any component in any component, regardless of who is who's child?
    Thank you!

    You need a broadcasting mechanism.
    Many architecture framework offers this facility, but as a quick hack you can try something like
    public class Broadcaster extends EventDispatcher  ( singleton anti pattern   )
    instance
    then just do Broadcaster.instance.addEventListener or removeEventListener. it's a crappy singleton, but at least it does not hold any global state.
    I've also seen people use Application.application to dispatch/listen globally but really don't like it.
    Note : Use weak references or your views will never be eligible for garbage collections.

  • Sevice Contract - Listener for Events Queue Issue

    Hi,
    The Listener for Events Queue in our Production environment ran very long, It took about 3+ hrs to complete the program. Is there any thing specific that we can check as part of RCA.
    Further there were 'library cache lock' found ... how this can impact the performance and how library cache lock works.
    Regards
    Tauseef E Ahmad

    Hi Team,
    i used the following code for recognizing the key events.
    String javaScriptKeyListener =
    " function keyListener() "
    +" { "
    +" alert(window.event.keyCode) ; } ";
    OAWebBean body = pageContext.getRootWebBean();
    if (body instanceof OABodyBean)
    ((OABodyBean)body).setOnLoad("onKeyPress = javascript:keyListener()");
    but it is not working as expected..
    Any suggestions ??
    Regards
    Sridhar

  • Listen for events from an embedded Swf

    Hi there,
    I have spend so long searching for an answer on the web but can not find any that works, please help!
    I'm not even sure if this is possible but if anyone can guide me in the right direction I would most appreciate it!
    Basically what I would like to do is to load a swf in to my flex application - contrary to my post title it doesnt even have to be embedded - when the loaded swf finishes playing it's animation I want for it to dispatch an event and for flex to listen for that event and trigger a function when the event is captured.
    The animation is made in Flash CS3. I have not used any classes, rather on the last frame I set up an action to dispatch an event like this:
    dispatchEvent(new Event("finishedPlaying"));
    In my Flex Application I load my swf using swfLoader and I add an event listener to it like so:
    mySwfLoader.addEventListener("finishedPlaying", test);
    and my function is like this:
    private function test():void
         trace("it worked!");
    This is not working at all and I'm sure I am missing something but I cant seem to find any straightforward answer on the internet!
    Is it at all possible for a swf made in flash to communicate with flex??
    Since they are both written in AS3, I figured it would be easy but alas!
    If anyone can help me I would most appreciate it, thank you in advance!!
    By the way I have also tried:
    mySwfLoader.content.addEventListener("finishedPlaying", test);
    but no luck....

    You have to wait for the swf to complete loading before adding the event listener.
    When are you adding the event listener?
    mySwfLoader.addEventListener("finishedPlaying", test);
    Have a look at the SWFLoader complete event:
    http://livedocs.adobe.com/flex/3/langref/mx/controls/SWFLoader.html#event:complete

  • .MXML files needed for WDR_TEST_FLASH_ISLAND

    Hi All
    Is there any place where we can get the .MXML files for SAP delivered WDR_TEST_FLASH_ISLAND demo WDA ?
    Please share if possible
    Thanks in advance

    1.  You can data bind with any public attribute or via GET/SET methods. The latter I would imagine would be more compatible with Caingorm. Look at the Google Maps example.  We use GET methods for the data binding in there.
    2. That seems like more a pure Flex design consideration. SAP really only provides information on how to work with the Islands. Nothing really Island specific about that. You would be better off searching other Adobe Flex resources.  Portal or ECC should be the same.  Set the FlashIsland UI element width and height based upon % to use up the allowed space.  Make sure the parent containers also use %.

  • Listen for event in own class?

    Hi
    I dispatch events from models to classes listening. How do you set up an event and listener in the same class?
    Eg for the former - a model "MyModel" to class - it's:
    public static const MY_VAR:String = "myVar";
    triggered by...
    dispatchEvent(new Event(MY_VAR));
    picked up in another class by...
    modelVar.addEventListener(MyModel.MY_VAR, doSomething);
    but what if the class that's dispatching also has the listener?
    So if MyClass is dispatching the event, along the lines of...
    addEventListener(MyClass.MY_VAR, doSomething);
    Cheers for taking a look

    Very often I'm waiting for a few key items before I can finally do something else. Setting simple flags or checking nulls can help with this.
    Often I download multiple data structures (JSON/XML/etc) and I need all of them before I can parse them because the co-depend on each other. URLLoaders finish at different times so I just set a flag for what I need but check if all are complete before I continue each time one finishes.
    e.g.
    package
         public class IHateWaiting extends EventDispatcher
              public static const MY_VAR:String = "myVar";
              private var _xmlA:XML;
              private var _xmlB:XML;
              public function IHateWaiting()
                   // load A
                   var ulA:URLLoader = new URLLoader();
                   ulA.addEventListener(Event.COMPLETE, _handleFinishedF);
                   ulA.load(new URLRequest("http://www.example.com/a.xml"));
                   // load B
                   var ulB:URLLoader = new URLLoader();
                   ulB.addEventListener(Event.COMPLETE, _handleFinishedF);
                   ulB.load(new URLRequest("http://www.example.com/b.xml"));
                   // listen to self
                   addEventListener(IHateWaiting.MY_VAR, _handleAppEventF);
              private function _handleFinishedF(e:Event):void
                   if (e.type == Event.COMPLETE)
                        var data:XML = XML(e.target.data);
                        // A or B? any way you can tell
                        if (data.A.length() > 0) _xmlA = data;
                        else if (data.B.length() > 0) _xmlB = data;
                        // event method (requires extra handler or a fake event)
                        if (_xmlA && _xmlB) dispatchEvent(new Event(IHateWaiting.MY_VAR));
                        // preferred direct reference, no handler needed
                        // if (_xmlA && _xmlB) _parseXML();
              private function _handleAppEventF(e:Event):void
                   if (e.type == IHateWaiting.MY_VAR) _parseXML();
              private function _parseXML():void
                    // parse XML
    I recommend the reference version from post #2. It's cleaner because you don't need to double up on functions (handler->reference) like you see above with dispatching. The only purpose for _handleAppEventF() in this case is just to run _parseXML(), which is a useless duplicate function.
    I've always kept my handlers free of model-esque logic, so you see me calling a different function from that handler, _parseXML(). This is just because I want my handlers to only handle events and then hand off the work elsewhere.
    Instead of dispatching the event, I agree with moccamaximum, run the method directly. Even if it's 2 lines of code to do 1 thing, I think the clarity of it is much cleaner coding. So I would recommend nuking the self-listener in the constructor above. When I have all the data I'm looking for, I'd run the methods in the class directly and If the parent needs to know, I'd dispatch when they complete.
    e.g.
              private function _handleFinishedF(e:Event):void
                   if (e.type == Event.COMPLETE)
                        var data:XML = XML(e.target.data);
                        // A or B? any way you can tell
                        if (data.A.length() > 0) _xmlA = data;
                        else if (data.B.length() > 0) _xmlB = data;
                        if (_xmlA && _xmlB)
                             // parse first (synchronous)
                             _parseXML();
                             // xml ready, dispatch to parent
                             dispatchEvent(new Event(IHateWaiting.MY_VAR));

  • Listen for events in another Gui class

    Most of the GUIs I have written to date have consisted of either a single class or multiple self-contained classes - mainly extensions of JPanel with JButtons etc to perform certain tasks.
    Now I want to be able to click a JButton in one class which will invoke a method in another.
    The code is too lengthy to post here but this is the general layout:
    JFrame Simulation_GUI contains a JPanel (panelMain) which is set as the content pane
    panelMain contains two GUI classes which extend JPanel;
    buttonPane > contains a number of JButtons, including the one I want to click
    loadingPane > contains the method (which takes a Hastable as an argument) I want to run
    All three panels are declared in the main class which extends JFrame, so I know that from there I can simply call;
    loadingPanel.runLoads(htData); but how do I do this from the JButton on the buttonPane.
    Any assistance greatly appreciated as I have little enough hair at the moment and can't afford to tear much more out.
    Thanks in advance

    Class GUI1 {
    //Display all the buttons.
    public void init() {
    Button.addActionListener(new
    ener(new SomeClass(this));
    Class SomeClass implements ActionListener {
    GUI1 gui = null;
    SomeClass(GUI1 gui) {
    this.gui = gui;
    public void actionPerformed(ActionEvent e) {
    //Do all your process here
    gui.setTable(table);    //table would be ur
    ould be ur hashtable
    }Cheers
    -PThis didn't fully answer my question but did two things:
    1. Told me that it is at least possible and it is just me having a senior moment,
    2. Sent me on the right road to finding a solution
    With additional help from the following post I have sorted my problem. Basically I had to centrallise the event handling into a different class. This was instantiated by the main GUI class and passed to the other GUI components as an argument.
    http://forum.java.sun.com/thread.jspa?threadID=576012&messageID=2881969
    Simple when you know how...!
    prashanth_kuppur - have some Duke Dollars on me and thanks for the poke in the right direction.

  • ICal no longer listening for event notifications in 10.5.4

    Up until 10.5.4, iCal would automatically add todo's and calendar events to its display when an event was created from an external app using the CalendarStore framework...
    Not anymore... The events are created, but you need to click on a different view to get iCal to realize something has been added to the calendar
    What's the normal way to submit a bug report to Apple on this?

    Hi,
    the normal way is to submit feedback over here: http://www.apple.com/feedback/ical.html
    Björn

  • Listening for click event

    I am curious, how can you have a child mxml page listen for
    an event from the parent?
    Let's say you have a button, call it 'btn1' on page1.mxml and
    you want to listen for the click event on page2.mxml. So far this
    is what I have:
    page1.mxml:
    <mx:Button id="btn1" />
    page2.mxml:
    <mx:Script>
    <![CDATA[
    private function btnListener(e:MouseEvent){
    Application.application.btn.addEventListener(MouseEvent.CLICK,
    setState(1));
    ]]>
    </mx:Script>

    "spacehog" <[email protected]> wrote in
    message
    news:glljts$g04$[email protected]..
    >I am curious, how can you have a child mxml page listen
    for an event from
    >the
    > parent?
    >
    > Let's say you have a button, call it 'btn1' on
    page1.mxml and you want to
    > listen for the click event on page2.mxml. So far this is
    what I have:
    >
    > page1.mxml:
    >
    > <mx:Button id="btn1" />
    >
    > page2.mxml:
    >
    > <mx:Script>
    > <![CDATA[
    >
    >
    > private function btnListener(e:MouseEvent){
    >
    Application.application.btn.addEventListener(MouseEvent.CLICK,
    > setState(1));
    > }
    > ]]>
    > </mx:Script>
    Check out Q3:
    http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.pdf

  • [svn] 3275: Initial check in for support for asdoc comments in mxml files.

    Revision: 3275
    Author: [email protected]
    Date: 2008-09-19 15:01:57 -0700 (Fri, 19 Sep 2008)
    Log Message:
    Initial check in for support for asdoc comments in mxml files.
    For adding comments at the class level or to properties defined inside mxml use the syntax
    Other tags supported in asdoc should also work. for example @see, @includeExamples etc.
    QA: Yes
    Doc:
    Reviewed By: Paul
    Tests: checkintests
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/AsDocAPI.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelClassesGenerator.ja va
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/ImplementationCompiler.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/ImplementationGenerator.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/InterfaceCompiler.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/MxmlCompiler.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/AbstractBuilder.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/DocumentBuilder.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/MxmlScanner.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/Node.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/gen/ClassDef.vm
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/Model.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/MxmlDocument.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/decl/PropertyDeclaration .java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/decl/UninitializedProper tyDeclaration.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/init/ValueInitializer.ja va
    flex/sdk/trunk/modules/compiler/src/java/flex2/tools/ASDocConfiguration.java
    Added Paths:
    flex/sdk/trunk/asdoc/templates/images/AirIcon12x12.gif
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/MxmlCommentUtil.java

    @John - no luck on the plugin angle. In checking both JDev installs that previously had the problems, they have the default extensions.
    @Dave - at the time I can't say we noticed any migration notices, we certainly didn't see the migration dialog though. However the application in SVN was built on the same version of JDev so I don't expect a migration to find any changes anyhow.
    However on your second point we always check out into an empty directory, as we're checking out the whole application. As such if as you say the migration utilities is always called, shouldn't that mean we always see the projects modified? We certainly don't, we're on a day by day basis checking out whole applications to different directories and we don't see that behaviour.
    In turn reconsidering the modified .jpr file, from what I saw it looks to me that the whole project file is re-set to it's original state. Initially the problem detected was the libraries attached to the project were gone so we couldn't compile, but in close inspection it seems the whole .jpr file has been modified to a rather vanilla setup.
    One thing I can say when we originally experienced the problem (and from memory this was true in the dim dark past when it also occurred another time), is it was a check out from a SVN tags directory, not the trunk. In thinking about it, it may be the first check out from the tags directory that we see the issue. However to get around the issue we just revert the project file in the tags directory, we don't actually change the SVN repository code (ie. commit), so the issue should keep occurring. Yet at the moment if we check out the same tags directory, the issue doesn't occur?
    Hmmm?
    Btw Dave, are you an Oracle employee?
    CM.

  • Listening for an event in main from a component

    Hi
    Ok so i have a Flash Builder project 4.5 that i created in Flash Catalyst thats draws all its data from MySql and four months into the build, as this is my first web project im noticing that when the page loads up in the browser it loads everything at once! and as im hoping to reuse some of the same components for diffrent tasks i assume that if i put the data retrivail under events that happen within the web page this will hopeful control the data flow as well as showing the correct data depending on CurrentState!
    The problem that im having is that my buttons are in my Main Application and the data retrival process is in my components! so i was trying to create addEventListener(MouseEvent.CLICK events in a component that was listening for events in my Main application. i have search the internet but every one is talking about the process in the main or component but not both!
    Does anyone know what im talking about and could you please share some light please

    Do you ever get to a point in programming where you think that perhaps i have choosen the wrong hobby to get infatuated about
    That code worked really well targetplanet but it had a side effect that just makes me nutts lol
      as it triggered a mouse event function in the component that was initialized in Main and just made my web site go nuts . the component that we initialized was a skin but its itemRenderer component that followed had the mouse event! perhaps i better start again with me learning perhaps i missed something
    or perhaps i should just have one component to one job instead of trying to be clever and mutitask with less components!

  • Listening to Events from inside loaded swf

    In Flash Builder 4 I have a swfLoader with which I load swf files. The swf files that get loaded get created in Flash Pro, and I would like to be able to listen for events from the level that they get loaded from. What would I have to specify in the Flash file for the path? Can't seem to be able to specify the right path.
    Thanks a lot for any help!

    I wouldnt say this is elegant but we have been having issues gaining direct access to the SWF's loaded in via OSMF. However I have done setups where I dispatch an event from a SWF and have it bubble up and catch it on the MediaContainer level. Not elegant but works- otherwise may need to make a custom MediaElement and bypass the SWFElement to gain tighter control - seems like there should be a better way, but I havnt found it.

  • How to use mxml file as a documnet class Pro CS6?

    Hello.
    I was given a gam example, and I cannot seem to get it to work. The document class is an mxml file, and for some reason when I put the directory in the Properties box it doesn't pick up the right file (clicking the pencil brings up an empty .as file)
    Does anyone have experience with this? Do I need to do something special to use an mxml document class?
    thanks.

    You only can use mxml files in Flex/FlashBuilder. They use a component model different from Flash Pro.
    With enough knowledge you could "translate"all the functionality and change most of the components manually, though.
    But there is no "automated" conversion, as far as I know.

  • How to listen for actionContent button click event in View

    Hello,
    Doing this:
    FlexGlobals.topLevelApplication.addEventListener('actionContentClick',showOptions);
    Results in calling showOptions() as many times as the view was showed. The handler sticks and each time I enter a view in the creationComplete hander for it I add the same listener over and over again.
    How should this be done?
    1. FlexGlobals.topLevelApplication is the right object to listen to?
    2. I can remove the listener on view deactivate, but I am not sure if that will be called each time the view goes away.
    3. Can I check if an object already has a listener and which is it?
    Thank you.

    Thank you, Tom.
    I was complicating things for myself by exposing methods in the main MXML file to add and remove and listen to click events on a button placed in the actionContent, instead of declaring it in MXML for each and adding a listener to it. Views had different actionContent buttons or rather icons for them.
    In regards to hasEvenListener, can I also get the method(s) attached to that? Probably not though.

  • Listening for an event outside of the object...

    Hey, I spent a lot of my day trying to figure out how to
    listen for an event outside of an instantiated object of my own.
    I made my own class called
    Link. When my Link class is instantiated, a Loader object
    (var loader:Loader) is added and it loads a user-specified external
    PNG file. I want to track the Event.COMPLETE event OUTSIDE of my
    Link class, like in my FLA's Actionscript.
    So, I tried a few things without any luck, and by these you
    might get the idea of exactly what I'm trying to do:
    var link1:Link = new Link(...);
    link1.loader.addEventListener(Event.COMPLETE, handler);
    That didn't work, so I tried:
    var link1.Link = new Link(...);
    var loader = link1.getChildByName("loader") as Loader;
    loader.addEventListener(Event.COMPLETE, handler);
    ... that didn't work either. :(
    Any ideas?
    If I am taking the completely wrong approach please do let me
    know. If there's ANY way to know WHEN my loader has completed
    loading its image outside of my Link class...
    Thanks!
    ~ Andrew Merskin

    Let your Link class handle the Loader events. When
    Event.COMPLETE fires,
    just redispatch the event or dispatch a custom event.
    Example 1:
    link1.addEventListener("ALLDONELOADING", linkEventHandler);
    function linkEventHandler(event:Event)
    if(event.type == "ALLDONELOADING")
    // do something or nothing at all
    // Inside your link class you are listening for the load
    complete
    function loadCompleteHandler(event:Event)
    dispatchEvent(new Event("ALLDONELOADING")));
    Example 2:
    link1.addEventListener(Event.COMPLETE, linkEventHandler);
    function linkEventHandler(event:Event)
    if(event.type == Event.COMPLETE)
    // do something or nothing at all
    // Inside your link class you are listening for the load
    complete
    function loadCompleteHandler(event:Event)
    dispatchEvent(event);

Maybe you are looking for

  • HP Pavilion g7 can't find or re-install HP Support Assistant & HP Solution Center

    After a week or so ago, I discovered my printer could no longer scan. Made several (& I mean several) attempts at following the instructions to install the full driver for my HP Photosmart C7180 printer. I then ordered the full drive CD for Window 7

  • Compressor video files disappearing

    I've been using compressor (in Final Cut Pro) to make all of the files for my current project and it has worked fine until I get to my main (largest) file. I am using "Best Quality 150 minutes". It takes over 12 hours to compress and goes through bot

  • Existing session is becoming null when returning from jsp

    Hi Guys ! I have an urgent requirement to meet in few days from now and got stuck with session problem in servlet. Scenario :- For the first time when i call a servlet a new sessoin is created and after some validations i forward to a jsp which has s

  • Subquery in the From Clause

    I have a query the contains a subquery in the from clause. The problem is how to join one of the tables in the subquery to one of the main tables. If I hard a value, the query runs, but using a table.column produced an "invalid column name" error. Ex

  • 9i Standard Edition

    Raj, Is it possible to deploy Marvel runtime in Oracle 9i standard edition?