MXML Application

Hi,
I'm fairly new to Flex and actionscript.
I found a Flex project on the net and I managed to make it work. It is about drag and drop functionality.
The MXML starts like this:
<ab:AlphabetBase 
xmlns="http://www.adobe.com/2006/mxml" horizontalGap="0" xmlns:qs="qs.controls.*" horizontalAlign="
left" paddingLeft="0" paddingTop="0" paddingBottom="0" paddingRight="0" layout="horizontal" backgroundColor="
#343434" xmlns:ab="AlphabetClasses.*"viewSourceURL="
/source/DragTile.zip" >
and in the project classes I added the AlphabetBase.as where the AlphabetBase class is defined.
I wanted to understand when and by whom is the AlphabetBase constructor?
I thought that the fact that the AlphabetBase is used in the begining of the MXML and not the Application triggered the constructor of the AlphabetBase class. But I removed the ab:AlphabetBase(replaced it with Application), and any other refference of the AlphabetBase, and placed a brealpoint in the constructor and then while debuging it still stopped on the Breakpoint, so I assume that it is loading all the classes in the project> is that correct?
As well, could somebody help me with the order in which the functions are executed(e.g. constructor of the Application class, then for each component in the MXML the constructor of the component... ).
Thank you,
Ronnyy

Classes should not be constructed unless used.  There is a chain of
dependencies starting with top-level tag that will bring classes into the
SWF, then code has to actually run that instantiates the class.  Using a
link-report will help you see how the class got into the SWF, and putting a
breakpoint on the constructor will help you see what code created it.

Similar Messages

  • Flex project vs. mxml application

    im totally new to flex and actionscript, coming from traditional web app development. ive been watching videos on lynda.com and it has gone well, but one thing it fails to mention and that i couldnt find in the forums or on google is the difference between creating a flex project and an mxml applciation. what's the difference?
    thanks!

    I don't know if you have  knowledge about java or C#.
    The project is a location where you collect all files that you need for your final application: mxml files, as filex, assets ....
    The mxml application is the mxml file that inherit mx:Application and is the main file of the project.
    Here is the start point of what you see in the browser.
    The red circle specify the project and the blue cicrle specify the mxml application.
    There is only one default mxml application in each project, but you can have many mxml files (that can be components) or mxml application that are applications.

  • Calling Java Methods in MXML Application

    Hai ,
    I am new to flex . I want to call a Java Method in my MXML
    Application . Can anyone give a Simple example for this One .
    Thanks
    Madhu

    Thanks. But When i run this Application it throws an Action
    Script Error Like this .
    [RPC Fault faultString="[MessagingError message='Destination
    'myObject' either does not exist or the destination has no channels
    defined (and the application does not define any default
    channels.)']" faultCode="InvokeFailed" faultDetail="Couldn't
    establish a connection to 'myObject'"]
    at mx.rpc::AbstractInvoker/
    http://www.adobe.com/2006/flex/mx/internal::invoke()[E:\dev\3.0.x\frameworks\projects\rpc\ src\mx\rpc\AbstractInvoker.as:257
    at mx.rpc.remoting.mxml::Operation/
    http://www.adobe.com/2006/flex/mx/internal::invoke()[E:\dev\3.0.x\frameworks\projects\rpc\ src\mx\rpc\remoting\mxml\Operation.as:197
    at
    mx.rpc.remoting::Operation/send()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\remotin g\Operation.as:113]
    at Function/
    http://adobe.com/AS3/2006/builtin::apply()
    at
    mx.rpc.remoting.mxml::Operation/send()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\re moting\mxml\Operation.as:170]
    at Function/
    http://adobe.com/AS3/2006/builtin::apply()
    at mx.rpc::AbstractService/
    http://www.adobe.com/2006/actionscript/flash/proxy::callProperty()[E:\dev\3.0.x\frameworks \projects\rpc\src\mx\rpc\AbstractService.as:285
    at s2/___s2_Button1_click()[C:\Workshop for eclipse\work
    space\Flex\DCSearch\flex_src\s2.mxml:6]
    Can u help me
    Madhu

  • Passing VARs between MXML Application and MXML components!

    Hi,
    I'm trying to pass a variable between the MXML Application and the MXML Component with ValueObjects.
    But when i call the variable on the MXML Component it is null!
    ValueObject Class Code:
    package valueObjects
        [Bindable]   
        public class MyGlobalVars
            public var NomeGaleria: String;
            public function MyGlobalVars()
    MXML Application Code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"  xmlns:comp="components.*" layout="vertical" height="100%" width="100%" >
    <mx:Script>
        <![CDATA[
            import valueObjects.MyGlobalVars;
            import mx.managers.PopUpManager;
            import mx.core.Container;
            [Bindable]
            public var nomeGaleria:MyGlobalVars;
            private function AbreGaleria():void{
                  nomeGaleria=new MyGlobalVars();
                nomeGaleria.NomeGaleria = "Moda";
                PopUpManager.addPopUp(new galeriaImagens(),this,true);
        ]]>
    </mx:Script>
    <mx:Panel height="673" width="839" verticalAlign="middle" borderStyle="none" layout="absolute">
        <mx:Canvas id="SMGaleria" width="815" height="30" x="2" y="98"">
            <mx:LinkButton x="474" y="5" label="moda" click="AbreGaleria()"/>   
         </mx:Canvas>
        <mx:ViewStack id="content" height="440" width="815" borderStyle="none" x="2" y="128">
            <comp:galeriaImagens id="GaleriaImagens" x="0" y="5" strGaleria="{nomeGaleria}"/>
        </mx:ViewStack>
    </mx:Panel>
    </mx:Application>
    MXML Component Code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:TitleWindow  xmlns:mx="http://www.adobe.com/2006/mxml"
        showCloseButton="true" creationComplete="CenterMe()" backgroundColor="#000000" xmlns:components="components.*" >
    <mx:Script>
        <![CDATA[
            import valueObjects.MyGlobalVars;
            import mx.controls.Alert;
            [Bindable]
            public var strGaleria:String;
            private function CenterMe(): void{
                 Alert.show(strGaleria);
        ]]>
    </mx:Script>
    </mx:TitleWindow>
    On the MXML component the value of strGaleria is null! It would not have to be: Moda??

    You may need to change your code as follows:
    <comp:galeriaImagens id="GaleriaImagens" x="0" y="5" strGaleria="{nomeGaleria.NomeGaleria}"/>
    Previously you had set strGaleria to the value of the object, not the string within the object.
    But I think you will still have a problem because function AbreGaleria will not be called until the user clicks the link button, and only then will NomeGaleria have a value, so I would set a default value as follows, otherwise at app launch it will be null:
    public var NomeGaleria: String = "";
    or  if that does not work
    public var NomeGaleria: String = " ";
    Another possible problem is that you are calling this code at the component creationComplete, but the LinkButton has not been clicked yet, so the value object string value has not been set, so the alert will not display anything:
    private function CenterMe():void{
        Alert.show(strGaleria);
    I think you need to reorganize some things here.
    If this post answers your question or helps, please mark it as such.

  • AIR 3.6 and MXML Applications ?

    My goal here is to compile an mxml application in FB 4.7 in order to have retina quality display.
    In order to do so, I followed the instructions to overlay the air sdk in FB 4.7 with the new air 3.6 sdk (AIR 3.6 SDK with ActionScript Compiler 2.0).
    I also followed the instructions in the air 3.6 sdk releasenote, and in order to enable retina display I changed the namespace to 3.6 in my application descriptor file, and I also add an xml line as explained.
    Now my mxml project won't compile, the error being :
    Processus terminé de manière inattendue.
    DVFreeThread - CFMachPortCreateWithPort hack = 0x2688e70, fPowerNotifyPort= 0x26888a0
    DVFreeThread - CFMachPortCreateWithPort hack = 0x59b6d0, fPowerNotifyPort= 0x599530
    invalid application descriptor: Unknown namespace: http://ns.adobe.com/air/application/3.6
    Détails de la commande de lancement :  "/Applications/Adobe Flash Builder 4.7/sdks/4.6.0/bin/adl" -runtime "/Applications/Adobe Flash Builder 4.7/sdks/4.6.0/runtimes/air/mac" /SERVEUR/TraceExplorer/AirTraceExplorer/AirTraceExplorer-app.xml /SERVEUR/TraceExplorer/AirTraceExplorer
    Then I read that "AIR 3.6 SDK with ActionScript Compiler 2.0" is only useful to compile AS3 project and won't work with mxml applications... Maybe that's why I have compilation problem ?
    My question is : Is it possible to compile mxml projects in Retina mode with Flash Builder 4.7 ?

    Cool it works ! Thank you Chris
    I am on Mac and relatively to these instructions I just overwrote files folder by folder (as Mac OS overwrite method is less subtle than windows one I suppose).

  • Passing value from one mxml application to another mxml application

    I am stuck up with a problem.
    what i am doing is i have created a mxml application which has user sign form ,
    this form accepts username and password and calls a remote object method checklogin()
    when it finds correct it must jump to another mxml file after succesful login .
    i have created remote object and i want to know how can we pass the username to another mxml application from the resulthandler function which handles the result for that function. Further i would like to ensure that session is handled correctly , whenever i press F5 or Refresh button after login i redirected to the state where i need to login again.
    plz Sugeest me some solutions..

    hi rajesh......
                       for using 2 components... you should go for component usage.... here is a God given tutorial which will guide you.
    [link|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/2e71ce83-0b01-0010-11a4-98c28a33195f ]
    ---regards,
       alex b justin

  • Adding a panel over other components in the main mxml application

    Hi,
    I've created a main mxml file that contains,among other things, a button, and another mxml that contains a panel with some options. I want to be able to add that panel to the main mxml OVER all other components in the main mxml file with a mouse click on the button in that main mxml. How can this be done, please help ?

    Hi mesanarapscallion,
    Can you please post the sample code you are working...
    Do you want to show the panel component on all the thing above in the main.mxml file...Do you have all the other things positioned at the same position..?
    Thanks,
    Bhasker Chari

  • Mxml application finishings

    Hi,
    Our applicaiton is completed. Thanks a lot for our team to
    help us in a lot of situations. It is time to deploy our first
    phase.
    We have observed our client site that the page is lot of
    .swfs but the page is loading very fastly. But our .mxml page is
    too slow to load. Is this problem of using flex1.5. and also we are
    using developer edition upto now. Is this also might be the
    problem?
    Thanks

    A few thoughts:
    The developer edition is not significant. The debug player is
    somewhat slower than the production player.
    The swf will be cached on the client after the first time it
    is downloaded, and subsequent loads should be noticeably faster.
    In your app, have you set creationPolicy="all" on any
    ViewStack or TabNavigator? If so, this is the main problem.
    Are you using many nested containers? VBox inside HBOX inside
    VBox in side grid, etc? This slows apps down.
    Any repeaters with more that 10-15 items?
    Tracy

  • How can I execute a java class with arguments from an air application built from mxml?

    I have an mxml application. It has a button, and when that button select event occurs, I want my mxml air app to pass arguments to a java class I have built, which resides in a package path on my system. I need to be able to pass several arguments to my java method from my mxml call. How do I do this, and what config files are necessary? For the simple task I want to engineer, can you show me an example of a properly configured config file? My java class has been executed at the command line in the past as follows:
    java -cp %CP% com.abc.prism.queue.EmitMessage XYZ "my message text" 192.12.13.14 5672
    where %CP% is an env variable that tells my class the classpath it runs with, and XYZ, "my message text", the IP address, and the port are the arguments I must pass from mxml to my java class. How do I accomplish this?
    How do I make known to the java class I call from mxml the %CP% class path? It tells my java class where to find various rabbitMQ jars.

    Hi,
    You need to use Integration technology like BlazeDS or LCDS.

  • Loading an "MXML Component" at run-time creates a null object.

    Hello!
    I have a simple Flex 3 project with an MXML application file (the parent) and an MXML component file (the child).
    At run-time I create childs of this component, and I add it to the stage using a simple "this.addChild()" call.
    Now, besides that, in the creation loop, after every
      newChild = new mcComp();
    I want to setup a few more custom parameters which belongs to this class. For example, now I want to set a label's text, this label is at the child.
    The issue is that the label isn't created until I exit the creation function, and actually, until my code returns control to the Flash Player.
    See my problem here?
    With custom classes which resides at .AS files, when I instantiate them with the "new" operator, they run their constructure's code and eveything is fine.
    But, when I do the same with those MXML components (which by the way are based over the Canvas class), their constructure do not execute and actually no other child of them is created.
    Can anyone please advise? I must be missing some keyword here.. hopefully.

    Hi Natasha thanks,
    The issue is that the creationComplete event doesn't dispatch even when I addChild() the object.
    var child:mcChild = null;
    for(var i:int; i < 3; i++)
         child = new mcChild();
         // setting some properties, labels' text etc'
         this.addChild(child);
    Try this and you'll see - the event doesn't dispatch until you got out of the code flow.
    Anyway after looking at Flex's documentation I solved it differently;
    After the addChild() call the child receives an "initialize" event. After that I could modify my label.
    Thank you though!

  • Sending a messaqe to Adobe Flex application

    Hi All,
    Flex has a messaging service and some tutorial show how to connect a Flex mxml application to a JMS queue.
    I have a web service which times out since it executes unit tests and returns the result. i would like to execute the underlying remote function module in background and on completion of the function module send a message to a Flex client.
    Can this be achieved through XI? And how could I achieve this?
    Thank you for your help,
    Philon

    Hi,
    As i understood,
    If XI would be in place , it will send messages to JMS Queue and it will then transfer data to Flex xml.
    Regards,
    Akshay.
    Don't Forget to give points.

  • How to contain a sub-component in the module instead of containing it in the main application

    Hi,
    I've 3 files
    Appln.mxml (application file)  ----  contains main application
    component.mxml (component file)  ----  contains component
    module.mxml (module file)  -----  contains module
    Generally the 'component.mxml' file will get loaded into the 'Appln.mxml' file (i.e., 'Appln.mxml' file will contain the custom component files) and whereas module file will get loaded on-demand.
    So Now instead of containing the data of 'component.mxml' file in the 'Appln.mxml',  I want to contain 'component.mxml' file data in the 'module.mxml' file itself and load the 'component.mxml' when module is loaded on-demand but not when application is loaded. So can any one please suggest me how to do it?
    Thanks in advance..

    Theo--
    You can delete software components & versions from the IR in XI 2.0.  (We're on Service Pack 5, and I've done it to clean up our IR.)
    Here is the process:
    1. Delete all configuration and/or import objects from the SCV.  Don't forget the 2 fault data types that SAP automatically creates in every namespace.
    1a.  Activate all change lists?  I don't remember for certain if this is needed here; if it won't let you save the deleted namespaces in step 2, then do this first.
    2. Double-click on the Software Component Version so that it comes up in the right pane.  Click on the change/edit button.  Delete all the namespaces from the SCV.  Save.
    3. Activate all change lists.  (It won't let you delete the SCV if you have uncommitted changes.)
    4. Open the SCV again (if it's not still open).  On the menu at the top of the right pane, go to Software Component Version...Delete.  You may or may not have to activate changes again.
    If I remember right, the software component will disappear automatically with the deletion of the last version.
    Hope this helps!
    --Dan King
    Capgemini

  • Changing themes of application in Flex 3

    Hi All ,below is my  mxml file , in which i am trying to change theme of my flex application by selecting the themes in combo box, but it is not working fine.Is there any bug in code ??? How to change the theme of flex application in Flex 3.. Plzz help...
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Script>
    <![CDATA[
               import mx.controls.Alert;
                import mx.collections.ArrayCollection;
                import mx.styles.StyleManager;
                private var cssLoader:URLLoader;
              private var cssRequest:URLRequest;
              [Bindable]
                public var cards:ArrayCollection = new ArrayCollection(
                    [ {label:"Theme 0", data:0},
                      {label:"Theme 1", data:1},
                      {label:"Theme 2", data:2},
                      {label:"Theme 3", data:3} ]);
                   private function closeHandler(event:Event):void {
                   if(event.target.selectedItem.data == 1){
                    cssLoader = new URLLoader();
                    cssRequest = new URLRequest("Alert.css");
                    cssLoader.addEventListener(Event.COMPLETE, cssLoaderComplete);
                    cssLoader.load(cssRequest);
                if(event.target.selectedItem.data == 2){
                  cssLoader = new URLLoader();
                    cssRequest = new URLRequest("Alert1.css");
                    cssLoader.addEventListener(Event.COMPLETE, cssLoaderComplete);
                    cssLoader.load(cssRequest);
                if(event.target.selectedItem.data == 3){
                  cssLoader = new URLLoader(); 
                    cssRequest = new URLRequest("Alert2.css");
                    cssLoader.addEventListener(Event.COMPLETE, cssLoaderComplete);
                    cssLoader.load(cssRequest);
                 private function cssLoaderComplete(event:Event):void
                     var sheet:StyleSheet = new StyleSheet();
                     sheet.parseCSS(cssLoader.data);
                     Application.application.styleSheet = sheet;
    ]]>
    </mx:Script>
    <mx:Button label="Click Me"  x="337" y="148"/>
    <mx:ComboBox dataProvider="{cards}" id="themeCombo" width="100"  change="closeHandler(event);" x="308" y="205"/>
    </mx:Application>

    Hi Bhasker,
    I work for big bank sector corp - Citigroup.,i am using themes to load themes dynamically using style manager class.i wrote a application which have 3 themes as a combo box items. when theme selected the look and feel of the same application's UI screen has to change. for the loading i used below mxml application. please advise me as need to submit this task today to implement all our project.it will be very gr8 if u can help me.
    <?xml version="1.0" encoding="utf-8"?><s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="
    library://ns.adobe.com/flex/spark" xmlns:mx="
    library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
     <fx:Script><![CDATA[
    import mx.controls.Alert;
    import mx.styles.StyleManager;
    import mx.events.StyleEvent;
    [Bindable] private var themes:Array = [ "AeonGraphical","Spark","Halo" ];
    private function initApp():void {
    //Initialize the ComboBox to the first theme in the themes Array.
    themesCmbBox.selectedIndex = themes.indexOf(0);
    private function thmsCmbChangeHandler(themeName:String):void {
    themeName= themesCmbBox.selectedLabel;
    if (themeName!=null && themeName == "AeonGraphical") {
    styleManager.loadStyleDeclarations("assets/AeonGraphical/AeonGraphical.swf");
    if (themeName!=null && themeName == "Spark") {
    styleManager.unloadStyleDeclarations("assets/AeonGraphical/AeonGraphical.swf");
    styleManager.loadStyleDeclarations("assets/Spark/spark.swf");
    if (themeName!=null && themeName == "Halo") {
    styleManager.unloadStyleDeclarations("assets/Spark/spark.swf");
    styleManager.loadStyleDeclarations("assets/Halo/halo.swf");
    private function registrationComplete():void {
    Alert.show('Thank you for registering!');
    private function clickClear(event:KeyboardEvent=null):void {
    if(event==null || event.keyCode == 13 ) {
    person.text = "" ;
    addr.text = "" ;
    city.text = "";
    state.text = "" ;
    zip.text = "" ;
    ]]>
    </fx:Script>
     <mx:Form id="Themes">
     <mx:FormItem>  
    <mx:Label text="{'Themes Demo in Flash 4'}" fontSize="35"/>  
    </mx:FormItem>  
    <mx:FormItem label="Themes" >  
    <mx:ComboBox id="themesCmbBox" dataProvider="{themes}" change="thmsCmbChangeHandler(themesCmbBox.selectedLabel)" />  
    </mx:FormItem>  
    <mx:FormItem label="Person Name">
     <mx:TextInput id="person" />
     </mx:FormItem>
     <mx:FormItem label="Street Address">
     <mx:TextInput id="addr"/>
     </mx:FormItem>
     <mx:FormItem label="City">
     <mx:TextInput id="city"/>
     </mx:FormItem>
     <mx:FormItem label="State">
     <mx:TextInput id="state" />
     </mx:FormItem>
     <mx:FormItem label="ZIP Code">
     <mx:TextInput id="zip" />
     </mx:FormItem>  
    </mx:Form>
     <mx:HBox>
     <mx:Button id="sub" label="{'Submit'}" y="100" click="registrationComplete()" />
     <mx:Button id="reset" label="{'Reset'}" buttonDown="clickClear()" keyDown="clickClear(event)" />
     </mx:HBox> 
    </s:Application>
    and i given the compiler option: -theme=${flexlib}/themes/Halo/halo.swc,${flexlib}/themes/Spark/spark.css,${flexlib}/theme s/AeonGraphical/AeonGraphical.css
    i tried with locally project assets path, and framework path nothing work out. and added these themes in the flex-config.xml file also. please advise me ASAP
    Advance Thanks,
    Usha
    Optional Information:
    Computer OS: Windows XP
    Programming Language: mxml/as3
    Compiler: flash 4.1.0

  • How to pass data from external Actionscript file to MXML file

    HI...
    I do not know about the Application.application.whateverFieldIWantToReference and it does work on my computer, but only when the external .as file is in the same folder as the main .mxml application... But in my case, the .as file is in another folder (ie. package)...
    Also i want to know When I use the standard Application.application way, it does not spit out any error, but it just doesn't work either.
    Alternatively, I guess I could pass the field (in this case, a  TextArea) as an argument, but how do I do that? How to pass a  TextArea(or any other element, for that matter) as an argument? What  type is it?
    Does anybody know how to circumvent this? Any help is appreciated,
    Thanks.

    HI...
    I do not know about the Application.application.whateverFieldIWantToReference and it does work on my computer, but only when the external .as file is in the same folder as the main .mxml application... But in my case, the .as file is in another folder (ie. package)...
    Also i want to know When I use the standard Application.application way, it does not spit out any error, but it just doesn't work either.
    Alternatively, I guess I could pass the field (in this case, a  TextArea) as an argument, but how do I do that? How to pass a  TextArea(or any other element, for that matter) as an argument? What  type is it?
    Does anybody know how to circumvent this? Any help is appreciated,
    Thanks.

  • Loading MXML Component Dynamically

    Hi all,
    I am new to Flex and was trying out small things . I created
    a MXML Application and also MXML components.
    I tried loading MXML component to application using xmlns and
    it worked fine.(
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" backgroundColor="#ffffff" xmlns:mi="com.*">
    <mi:base1 id="base1" />
    <mi:base2 id="base2" />
    This method is ok if we are loading 3-4 components .
    but , if i have to load a mxml component dynamically how do I
    do it?
    for example ,if base1 and base2 are two components and i want
    to load them based on some event performed.
    I have tried the method which uses ViewStack and code
    myViewStack.selectedChild=Container(myViewStack.getChildByName(selectedNode))
    ,where each child will have one component declared or initialized.
    Following this method is not a feasible when we have hundred
    of components to be loaded.
    Can anyone help me on this??

    "srirama.83" <[email protected]> wrote in
    message
    news:gpkoui$g3u$[email protected]..
    > Hi all,
    > I am new to Flex and was trying out small things . I
    created a MXML
    > Application and also MXML components.
    > I tried loading MXML component to application using
    xmlns and it worked
    > fine.(
    > <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    > layout="absolute"
    > backgroundColor="#ffffff" xmlns:mi="com.*">
    > <mi:base1 id="base1" />
    > <mi:base2 id="base2" />
    > )
    > This method is ok if we are loading 3-4 components .
    > but , if i have to load a mxml component dynamically how
    do I do it?
    > for example ,if base1 and base2 are two components and i
    want to load them
    > based on some event performed.
    >
    > I have tried the method which uses ViewStack and code
    >
    myViewStack.selectedChild=Container(myViewStack.getChildByName(selectedNode))
    > ,where each child will have one component declared or
    initialized.
    >
    > Following this method is not a feasible when we have
    hundred of components
    > to
    > be loaded.
    > Can anyone help me on this??
    >
    >
    http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.pdf
    Q4

Maybe you are looking for