Number of states vs more .mxml files

I am trying th figure out the best approach.  After login I change states and have a menu that can do is 7 different direction based on selection.
What is the advantage/disadvantage of changing the state of the current .mxml file verses having 7 different mxml files?
Thanks,
Pete

Right now I am developing an application and I have my main application with the following components.
AppHeader
AppFooter
AppContent
Then the AppContent MXML file contains many states for the different menus, around 7.
These states show one at a time using a TabNavigator to display the content is the one section of the screen.
One of the states has another set of nested components
Right now I am having a VERY difficult time getting information into my database. I think it is because of the number of states and components. I am coming to believe that you have to be at the application mxml file to send information but I could be wrong. The only problem with components and state nesting is that it can get out of control quickly. It might better to refactor the application. I plan on doing this after the initial assessment from my managers.

Similar Messages

  • Declaring skin states in an MXML component?

    From the docs, you can declare skin states in a .as file before the class declaration, like this:
    [SkinState("up")]
    [SkinState("over")]
    [SkinState("down")]
    [SkinState("disabled")]
    public class Button extends Component { .. }
    But how do declare states in a .mxml file?  There is no "public class ..." statement to precede.

    So maybe this isn't possible?  I have had such a hard time finding docs on the component side of the skinning contract.

  • Not able to get the data from variables contained in more than 1 mxml file

    I have got 5 Bindable Public integer variables in total in 5 mxml files (Pages). Each variable is assigned it's value in a Public function in each of the mxml files.
    What I need to do is add up the values of the 5 variables. The way I approached this was to create a public function add5Variable in my main mxml file (Page1) as shown below.
    [Bindable]
    public var varTotal:int = 0;
    public  
    varTotal = (variableP1 +
    Page2.variableP2 + Page3.variableP3 + Page4.variableP4 + Page5.variableP5);
    return(varTotal);
    I have got a TextInput field on Page5 where I display the varTotal. The function add5Variable is called when moving from Page to Page.
    The results I am getting is that the varTotal will always be the value of variableP1. When I tried some debugging in Flex Builder it showed me that the other 4 variables had a value of 0.
    Why is this the case and do you have any suggestions on how I can get the correct total for varTotal?
    Thanks
    function add5Variable():int {

    The code below looks correct. Is that the expected behavior of your app?
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Script>
    <![CDATA[
    public var ValueP2:Number = 0;
    private var grossValue:Number = 0;
    private var totalValue:Number = 0;
    private var finalTotalP2:int = 0;
    public function test():void {
    if (Number(TextInput2.text) == 1 || Number(TextInput2.text) == 2)
    ValueP2 = 1;
    totalValue = grossValue + ValueP2;
    else if (Number(TextInput2.text) == 3 || Number(TextInput2.text) == 4) {
    ValueP2 = 5;
    totalValue = grossValue + ValueP2;
    else if (Number(TextInput2.text) == 5 || Number(TextInput2.text) == 6) {
    ValueP2 = 9;
    totalValue = grossValue + ValueP2;
    trace("totalValue "+totalValue);
    finalValueP2(totalValue);
    public function finalValueP2(tVP2:int):int {
    var tallyP2:int = 0;
    if (tVP2 < 3)tallyP2 = 1;
    if (tVP2 >= 3 && tVP2 <5)tallyP2 = 2;
    if (tVP2 >= 5 && tVP2 <10)tallyP2 = 3;
    finalTotalP2 = tallyP2 * 7;
    trace("finalTotalP2 " +finalTotalP2);
    return(finalTotalP2);
    ]]>
    </mx:Script>
    <mx:TextInput id="TextInput2" enter="test()"/>
    </mx:Application>

  • Eclipse +flex 3 plugin crashes when trying to see mxml file in design mode

    Hi,
    I have strange problem I've been struggling with for 3 days.
    I have eclipse-jee-europa-fall2-win32(eclipse europa 3.3.1.1)
    + adobe flex 3 eclipse plugin.
    My workspace consists of several projects + one library.
    There is not problem when trying to edit any mxml file when
    my library is not imported yet. Once I import it to my workspace I
    cannot see any mxml file in design mode since it crashes with the
    following msg in log:
    Did anyone have similar problem and maybe knows the
    solutiuon? I've reinstalled/redownoaded eclipse, flex plugin, flash
    players and so on. What's more it happens only on my machine - same
    project on different one works without crushing.
    !ENTRY org.eclipse.osgi 2 0 2008-02-22 09:13:18.046
    !MESSAGE While loading class
    "org.eclipse.mylyn.tasks.ui.TasksUiPlugin", thread
    "Thread[main,6,main]" timed out waiting (5000ms) for thread
    "Thread[Worker-0,5,main]" to finish starting bundle
    "update@plugins/org.eclipse.mylyn.tasks.ui_2.1.0.v20070927-0900.jar
    [313]". To avoid deadlock, thread "Thread[main,6,main]" is
    proceeding but "org.eclipse.mylyn.tasks.ui.TasksUiPlugin" may not
    be fully initialized.
    !STACK 0
    org.osgi.framework.BundleException: State change in progress
    for bundle
    "update@plugins/org.eclipse.mylyn.tasks.ui_2.1.0.v20070927-0900.jar"
    by thread "Worker-0".
    at
    org.eclipse.osgi.framework.internal.core.AbstractBundle.beginStateChange(AbstractBundle.j ava:1141)
    at
    org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:258)
    at
    org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:400)
    at
    org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLa zyStarter.java:111)
    at
    org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java :417)
    at
    org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoade r.java:189)
    at
    org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:34 0)
    at
    org.eclipse.osgi.framework.internal.core.SingleSourcePackage.loadClass(SingleSourcePackag e.java:37)
    at
    org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java :405)
    at
    org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:369)
    at
    org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:357)
    at
    org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.jav a:83)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at
    org.eclipse.mylyn.context.ui.ContextUiPlugin$5.run(ContextUiPlugin.java:258)
    at
    org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at
    org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
    at
    org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3659)
    at
    org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3296)
    at
    org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
    at
    org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
    at
    org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
    at
    org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
    at
    org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
    at
    org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
    at
    org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at
    org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
    at
    org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169)
    at
    org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLau ncher.java:106)
    at
    org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.jav a:76)
    at
    org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
    at
    org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
    Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
    Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
    Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at
    org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
    Caused by:
    org.eclipse.osgi.framework.internal.core.AbstractBundle$BundleStatusException
    ... 40 more
    Root exception:
    org.eclipse.osgi.framework.internal.core.AbstractBundle$BundleStatusException
    at
    org.eclipse.osgi.framework.internal.core.AbstractBundle.beginStateChange(AbstractBundle.j ava:1141)
    at
    org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:258)
    at
    org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:400)
    at
    org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLa zyStarter.java:111)
    at
    org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java :417)
    at
    org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoade r.java:189)
    at
    org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:34 0)
    at
    org.eclipse.osgi.framework.internal.core.SingleSourcePackage.loadClass(SingleSourcePackag e.java:37)
    at
    org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java :405)
    at
    org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:369)
    at
    org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:357)
    at
    org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.jav a:83)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at
    org.eclipse.mylyn.context.ui.ContextUiPlugin$5.run(ContextUiPlugin.java:258)
    at
    org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at
    org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
    at
    org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3659)
    at
    org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3296)
    at
    org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
    at
    org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
    at
    org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
    at
    org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
    at
    org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
    at
    org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
    at
    org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at
    org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
    at
    org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169)
    at
    org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLau ncher.java:106)
    at
    org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.jav a:76)
    at
    org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
    at
    org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
    Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
    Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
    Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at
    org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
    !ENTRY org.eclipse.help 4 0 2008-02-22 09:18:14.375
    !MESSAGE Required attribute "label" missing from "topic"
    element in "/com.adobe.flexbuilder.help/tocAPI.xml" (skipping
    element)
    !ENTRY org.eclipse.help 4 0 2008-02-22 09:18:14.375
    !MESSAGE Required attribute "label" missing from "topic"
    element in "/com.adobe.flexbuilder.help/tocAPI.xml" (skipping
    element)
    !ENTRY org.eclipse.help 4 0 2008-02-22 09:18:14.375
    !MESSAGE Required attribute "label" missing from "topic"
    element in "/com.adobe.flexbuilder.help/tocAPI.xml" (skipping
    element)
    !ENTRY org.eclipse.help 4 0 2008-02-22 09:18:14.375
    !MESSAGE Required attribute "label" missing from "topic"
    element in "/com.adobe.flexbuilder.help/tocAPI.xml" (skipping
    element)

    I've found solution by myself so I'll present it here. Maybe
    someone will need it.
    The problem of such behaviour was that Flex plugin always (at
    least on my pc) wants to ustart eclipse using its own JRE from here
    C:\Program Files\Adobe\Flex Builder 3 Plug-in\jre (default dir).
    This environment is Java 5. When you go to
    eclipse>window>preferences>Java>Installed JREs and you
    delete default Flex JRE, add new to point to for example C:\Program
    Files\Java\jre1.6.0_04 eclipse still uses JRE from C:\Program
    Files\Adobe\Flex Builder 3 Plug-in\jre. Do not know why
    Flex/eclipse does that but if you simply overwrite C:\Program
    Files\Adobe\Flex Builder 3 Plug-in\jre files with newer JRE from
    C:\Program Files\Java\jre1.6.0_04 all works perfectly.
    Hope it helps somebody ;-)
    thanks Artur

  • Implement forms in different .mxml files

    Hi!
    I'm starting developing an application with Flex wich will
    have differente views. I wonder if it is possible to implement each
    view in a different .mxml file and how to do it. I now it is
    possible to define states but what I want is to define different
    forms (that probably would have states).
    Any help will be appreciated.
    Thank you.

    Yes, you can create separate .mxml files for just about
    anything. So you could create a new .mxml for each "form" view
    where <mx:Form> is the root of each file.
    States apply only to the file they are defined in, so you can
    have a form with different states based on form item selection. I
    can then nest components with states within on another.
    Also, as Greg points out, "States" are not used for
    navigation, that is what the navigator containers are for. (i.e.
    ViewStack, TabNavigator, etc...) States are for modifying a
    component slightly based on an event.
    Using your example, if a user selects a specific option in a
    ComboBox, you add another TextInput to the form. In a more generic
    example, you display a catalog of products. When the user mouses
    over a product, the image is highlighted and an add to cart button
    appears.
    HTH

  • Passing parameters between mxml files(used in viewstack).

    Hi All,
       In login page, I'm calling RemoteObject method for validating user credentials. In login success, I'd like to keep user name in a variable and call menu page where it is having menu for the application. In menu.xml file, I'm putting home tab is a default selection.
        Depending upon login username it should fetch data for displaying DataGrid in home page. Please find my code
       //Login Page Begin(login.mxml)
      <mx:Script >
            <![CDATA[
       private function login_resultHandler(event:ResultEvent):void
                    userdetails = event.result as ArrayCollection
                    Alert.show("userdetails 0:",userdetails.getItemAt(0).toString());
                    Alert.show("userdetails 1:",userdetails.getItemAt(1).toString());
                    if(userdetails!=null && userdetails.length>=1)
                        login_ViewStack.selectedIndex=1;
                    else
                        loginmessage.visible=true;
    ]]>
        </mx:Script>
       <mx:ViewStack x="0" y="0" id="login_ViewStack" width="100%" height="100%" creationPolicy="all" borderStyle="solid">
            <mx:Canvas label="loginpage" width="100%" height="100%">
                <mx:Form x="213" y="137" height="153" width="348">
                    <mx:FormItem width="262" required="false" height="25" label="Username: " fontSize="14" fontWeight="bold">
                        <mx:TextInput id="username_text"/>
                    </mx:FormItem>
                    <mx:FormItem label="Password: " fontSize="14" fontWeight="bold" width="262">
                        <mx:TextInput id="password_text" displayAsPassword="true" enter="ro_login.checkLogin(username_text.text,password_text.text);"/>
                    </mx:FormItem>
                    <mx:FormItem width="265">
                    </mx:FormItem>
                    <mx:FormItem width="251" label="" horizontalAlign="center">
                        <mx:Button label="login" click="ro_login.checkLogin(username_text.text,password_text.text);"/>
                    </mx:FormItem>
                </mx:Form>
                <mx:FormHeading x="213" y="109" label="Login Page" width="124" fontWeight="bold" fontSize="16"/>
                <mx:Text x="213" y="83" text="Invalid Username and password" id="loginmessage" color="#F43D13" fontSize="16" fontWeight="bold" visible="false"/>
            </mx:Canvas>
            <local:menu id="menu_setup" label="" xmlns:local="*"/>
            </mx:ViewStack>
       //Login Page End
       In checkLogin method, it is validating username/password. and I'm selecting view stack '1' for displaying menu.
      //Menu Page Begin(menu.mxml)
      <mx:Script >
             <![CDATA[
    public function init(): void{        
                myViewStack.visible=true;
                selectedmenu="HOME";
    ]]>
         </mx:Script>
      <mx:Panel  width="100%" height="100%" layout="absolute">
            <mx:ToggleButtonBar id="mainmenu" width="60%" height="39" itemClick="fillsubmenu(event);" dataProvider="myViewStack" buttonMode="true" autoLayout="true" styleName="mystyle" x="118"/>
            <mx:ViewStack id="myViewStack" borderStyle="solid" width="100%" height="465" creationPolicy="all" visible="true"  y="67" x="10">
                <local:home id="page1" label="HOME" xmlns:local="*"/>
                <local:newcontact id="page2" label="NEW CONTACT" xmlns:local="*"/>
                <local:search id="page3" label="SEARCH" xmlns:local="*"/>
                <local:help id="page4" label="HELP" xmlns:local="*"/>
            </mx:ViewStack>
        </mx:Panel>
    </mx:Canvas>
      //Menu Page End
      //HOME Page Begin(menu.mxml)
      <mx:RemoteObject id="ro_records" destination="inquiryService" result="getInquries_resultHandler(event)"
                         endpoint="http://localhost:7001/flexbb/spring/messagebroker/amf">
            <mx:method name="getInquires" result="getInquries_resultHandler(event)"/>
        </mx:RemoteObject>
        <mx:DataGrid id="dg" width="100%" height="100%">
                <mx:columns>
                    <mx:DataGridColumn dataField="inquiry_id" headerText="Report Id"/>
                    <mx:DataGridColumn dataField="inquiry_type" headerText="Report Type"/>
                    <mx:DataGridColumn dataField="full_name" headerText=" Consumer Name"/>
                </mx:columns>
          </mx:DataGrid>
      //HOME Page End
       I'm having following questions:
       How to keep username in session scope. Need to be accessed in all pages.
       How to pass username from login page to home page.
       In HOME page, if I mention 'creationComplete="ro_records.getinquires()"' it will be invoked when I call login.mxml file, so how to invoke getinquires() method passing username when login is successful.
       Thanks in advance.
    Regards,
    Sharath.

    If this post answered your question or helped, please mark it as such.
    To keep username in session scope, so it can be accessed in all pages, and to pass the user name from login to home page, you use custom events, as in my example application. The Flex project archive is attached, but here is the code:
    -------------- assets\css\appHeader.css -----------------
    /* CSS file */
    .welcomeLabel{
      fontSize: 20;
      color: #FFFFFF;
      left: 50;
      verticalCenter: 0;
    .titleLabel{
      horizontalCenter: 0;
      verticalCenter: 0;
      fontSize: 24;
    .loginButton{
      right: 30;
      verticalCenter: 0; 
    ---------------- com\westernstates\classes\controller\WesternStatesController.as -------------------
    package com.westernstates.classes.controller
      import com.westernstates.classes.events.*;
      import com.westernstates.classes.model.*;
      import flash.display.DisplayObject;
      import flash.events.Event;
      import mx.core.UIComponent;
      import mx.events.FlexEvent;
      import mx.managers.PopUpManager;
      // This class forms the "controller" of the MVC (Model-View-Controller)
      // architecture used in this application. Rather than have code in the
      // application and in components, the MVC architecture relies on events
      // handled in the controller.
      // Extend UIComponent so this class has a reference to systemManager,
      // so all events that bubble can be handled.
      public class WesternStatesController extends UIComponent{
        // The constructor uses this classes creationComplete event
        // to call the setupEventListeners method to register events
        // with the controller that allow it to "control" much of the
        // application, and also to popup the Login form.
        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(LoginEvent.LOGIN, login, true);
          systemManager.addEventListener(LoginSuccessEvent.LOGIN_SUCCESS, handleLogin, true);
          systemManager.addEventListener(LoginFailureEvent.LOGIN_FAILURE, handleLogin, true);
          login(new LoginEvent(LoginEvent.LOGIN));
        private function login(evt:LoginEvent):void{
          PopUpManager.addPopUp(WesternStatesModel.appLogin, WesternStatesModel.app as DisplayObject, true); 
        private function handleLogin(evt:LoginEvent):void{
          if(evt.type == LoginSuccessEvent.LOGIN_SUCCESS){
            WesternStatesModel.userInfo.userName = LoginSuccessEvent(evt).userName;
            WesternStatesModel.appHeader.currentState = "loginSuccess";
          }else if(evt.type == LoginFailureEvent.LOGIN_FAILURE){
            WesternStatesModel.appHeader.currentState = "loginFailure";
            WesternStatesModel.appLogin.reset();
    ----------------------- com\westernstates\classes\events\LoginEvent.as -----------------
    package com.westernstates.classes.events
      import flash.events.Event;
      /* This custom event is the base class from which other login related
       * events are derived. This makes it possible to dispatch a login related
       * event and set the loginEventType property, and then in the event handler,
       * check this property and execute based on the login event type.
       * In reality, extending this class doesn't really provide much additional
       * value, but from a conceptual standpoint it might make sense, and as we
       * develop the application further, we might develop this class further.
      public class LoginEvent extends Event{
        public static const LOGIN:String = "login";  
        public function LoginEvent(type:String){
          super(type, true);
    ------------------ com\westernstates\classes\events\LoginFailureEvent.as ------------------
    package com.westernstates.classes.events
      import flash.events.Event;
      // This custom event should be dispatched if the user fails to
      // successfully log into the application.
      public class LoginFailureEvent extends LoginEvent{
        public static const LOGIN_FAILURE:String = "loginFailure";  
        public function LoginFailureEvent(){
          super(LoginFailureEvent.LOGIN_FAILURE);
    ---------------------- com\westernstates\classes\events\LoginSuccessEvent.as -----------------
    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 LoginSuccessEvent extends LoginEvent{   
        public static const LOGIN_SUCCESS:String = "loginSuccess"; 
        private var _userName:String;
        public function LoginSuccessEvent(userName:String){
          // Store the username for the user that successfully logged in.
          // The application can access the username from the event object.
          this._userName = userName;
          super(LoginSuccessEvent.LOGIN_SUCCESS);
        // A getter is necessary for the application to be able to access the private
        // variable containing the username for the user that successfully logged in.
        // A setter is unnecessary because the username is determined upon login
        // and there is no reason to change it.
        public function get userName():String{
          return this._userName;
    --------------------- com\westernstates\classes\misc\User.as -----------------
    /* This class is used to store information about the user currently logged in.
       The user's password should not be stored here. Currently only the username
       is stored in this class, but later we will add more data.
    package com.westernstates.classes.misc
      [Bindable]
      public class User
        // The public accessor methods (a getter and a setter) allow us to access this private variable.
        private var _userName:String;
        public function User(){
        public function get userName():String{
          return this._userName;
        public function set userName(user:String):void{
          this._userName = user;
    ------------------ src\com\westernstates\classes\model\WesternStatesModel.as ---------------
    package com.westernstates.classes.model
      import com.westernstates.classes.misc.*;
      import components.*;
      import mx.core.Application;
      // This class forms the "model" of the MVC (Model-View-Controller)
      // architecture used in this application. Data that would otherwise
      // be found in the application or component files are centralized here.
      public class WesternStatesModel{
        // This variable allows us to enforce having only one model object,
        // and provides an entry point to access the data in the model.
        private static var instance:WesternStatesModel;
        // This variable is a convenience obj allowing us to access the
        // main app children when necessary. It would be better to replace
        // this with an event, making even greater use of the MVC architecture.
        public static var app:Object = mx.core.Application.application;
        // This object is used to store information about the user currently logged in.
        [Bindable] public static var userInfo:User = new User();
        // References to UI components.
        public static var appHeader:ApplicationHeader = app.appHeader;
        public static var appLogin:Login = new Login();
        // Ensure only one instance of the model exists at any time (singleton).
        public function WesternStatesModel(){
          if( instance != null ){
            throw( new Error( "There can only be one instance of WesternStatesModel." ) );
        // This method is used throughout to access non-static variables of the model.
        public static function getInstance():WesternStatesModel{
          if( instance == null ){
            instance = new WesternStatesModel();
          return instance;
    -------------------- src\components\ApplicationHeader.mxml ----------------
    <?xml version="1.0" encoding="utf-8"?>
    <mx:ApplicationControlBar xmlns:mx="http://www.adobe.com/2006/mxml"
      width="100%" dock="true">
      <mx:Script>
        <![CDATA[
          import com.westernstates.classes.events.*;
          import com.westernstates.classes.model.WesternStatesModel;
          private function logInOut(evt:MouseEvent):void{
            if(evt.currentTarget.label == "Login"){
              this.dispatchEvent(new LoginEvent(LoginEvent.LOGIN));
            }else{
              this.currentState = "";
        ]]>
      </mx:Script>
      <!--
        This component is the docked control bar at the top of the application,
        where we display a welcome message upon successful login, or a login
        error message for login failure. We also have the main application
        title label, and utility buttons such as Logout/Login.
      -->
      <!--
        The external css file supports our architecture of separating the
        definition of the UI from style rendering.
      -->
      <mx:Style source="../assets/css/appHeader.css"/>
      <!--
        States allow us to control changes in the labels and buttons.
        State changes are managed by the controller class.
      -->
      <mx:states>
        <mx:State name="loginSuccess">
          <!--
            The binding braces { } are necessary to resolve the entire welcome
            string using hard coded pieces and the username in the model.
          -->
          <mx:SetProperty target="{welcomeLbl}" name="text"
            value="{'Welcome ' + WesternStatesModel.userInfo.userName + ' !!!'}"/>
          <mx:SetProperty target="{welcomeLbl}" name="visible" value="true"/>
          <mx:SetProperty target="{loginBtn}" name="label" value="Logout"/>
        </mx:State>
        <mx:State name="loginFailure">
          <mx:SetProperty target="{welcomeLbl}" name="text" value="LOGIN FAILED !!!"/>
          <mx:SetProperty target="{welcomeLbl}" name="visible" value="true"/>
        </mx:State>
      </mx:states>
      <!--
        Usually we would try to use auto-layout containers, such as VBox, HBox, etc.
        but the application header is a simple component and we want to anchor labels
        and buttons to the left and right sides of the component, or center them,
        and a Canvas and constraint based layout makes this easier. The constraint
        based layout settings are in the css file.
      -->
      <mx:Canvas width="100%" height="100%">
        <mx:Label id="welcomeLbl" text="Welcome !!!" visible="false" styleName="welcomeLabel"/>
        <mx:Label id="titleLbl" styleName="titleLabel" text="Western Gallery of Photography"/>
        <mx:Button id="loginBtn" label="Login" click="logInOut(event);" styleName="loginButton"/>
      </mx:Canvas>
    </mx:ApplicationControlBar>
    ------------------- src\components\Login.mxml -------------------
    <?xml version="1.0" ?>
    <mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml"
      title="Login" horizontalScrollPolicy="off"
      verticalScrollPolicy="off" creationComplete="init();"
      defaultButton="{loginBtn}">
      <mx:Script>
        <![CDATA[
          import mx.controls.Alert;
          import com.westernstates.classes.events.*;
          import mx.collections.ArrayCollection;
          import mx.managers.PopUpManager;
          // This test username and password would not be here in a real application.
          private var testUser:String = "user1";
          private var testPwd:String = "testme";
          private function init():void{
            this.reset();
            PopUpManager.centerPopUp(this);
          public function reset():void{
            userTxt.text = "";
            passwordTxt.text = "";
          private function login(evt:Event):void{
            if(userTxt.text == testUser && passwordTxt.text == testPwd){
              this.dispatchEvent(new LoginSuccessEvent(userTxt.text));
              this.reset();
              PopUpManager.removePopUp(this);
            }else{
              this.dispatchEvent(new LoginFailureEvent());
              mx.controls.Alert.show("Login Failed!!!");
        ]]>
      </mx:Script>
      <!--
        Currently this login form is very basic. Later we will add validation,
        states, effects, etc.
      -->
        <mx:Form id="loginForm">
          <mx:FormItem label="Username:">
            <mx:TextInput id="userTxt"/>
          </mx:FormItem>
          <mx:FormItem label="Password:">
            <mx:TextInput id="passwordTxt"
              displayAsPassword="true"/>
          </mx:FormItem>
        </mx:Form>
        <mx:ControlBar horizontalAlign="center">
          <mx:Button label="Login" id="loginBtn" click="login(event);"/>
        </mx:ControlBar>
    </mx:Panel>
    ------------------ MainApp.mxml -------------
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
      xmlns:controller="com.westernstates.classes.controller.*"
      xmlns:comp="components.*" viewSourceURL="srcview/index.html">
      <!--
        Because we have broken this application into components, the main application
        file currently does not have much in it. It is possible to argue for simply
        defining the application header here in the main application file, but you
        might use it in other applications or components, so it is implemented as
        a separate component.
      -->
      <!-- The WesternStatesController class. It registers event listeners
        with the systemManager for events that will bubble up the display hierarchy.
        The controller is a non-visual class, although it does extend UIComponent
        so it is on the display list, but it has no visual elements. -->
      <controller:WesternStatesController/> 
      <comp:ApplicationHeader id="appHeader"/>
    </mx:Application>

  • In SQL Trace how to see which statement getting more time .

    Hi Expart,
    In SQL Trace (T-code ST05) . I am running the standard transaction . how to see which statement
    running more time and less time . suppose one statement running more time so how resolve the
    performance .
    Plz. reply me
    Regards
    Razz

    > The ones in 'RED' color are the statement which are taking a lot of time and you need to
    > optimise the same.
    No, that is incorrect, the red ones show only the ones which need several hundret milliseconds in one execution. This can even be correct for hard tasks. And there are lots of problem, which you will not see
    I have said everything here:
    SQL trace:
    /people/siegfried.boes/blog/2007/09/05/the-sql-trace-st05-150-quick-and-easy
    Go to 'Tracelist' -> Summarize by SQL statements', this is the view which you want to see!
    I summarizes all executions of the same statement.
    There are even the checks explained, the slow ones are the one which need a lot of time per record!
    See MinTime/Rec > 10.000 microseconds.
    Check all number of records, executions, buffer, identicals.
    The SE30 Tipps and Tricks will not help much.
    Siegfried

  • Compile multiple mxml file at same time

    hi
    i am working in flex with java.
    i am using more one flex file in my flex project.
    when i execute the project the ant compiled .mxml file only executed.
    the other .mxml files are not executed.
    i have use the destination id  same of two mxml files.
    the ant target is
    <target name="appcompile" depends="install">
      <mxmlc file="${flexsrc.home}/UserRegistration.mxml" context-root="/Reg" keep-generated-actionscript="true" services="${web.home}/WEB-INF/flex/services-config.xml" output="${catalina.home}/webapps/${app.name}/UserRegistration.swf">
       <compiler.library-path dir="${FLEX_HOME}/frameworks" append="true">
        <include name="${web.home}/WEB-INF/lib/" />
        <include name="${flexsrc.home}/example/" />
       </compiler.library-path>
       <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml" />
       <source-path path-element="${FLEX_HOME}/frameworks" />
      </mxmlc>
    </target>
    <target name="createHtmlWrapper" depends="appcompile">
      <html-wrapper application="${APP_ROOT}/UserRegistration.mxml" height="1000" width="1000"  output="${catalina.home}/webapps/${app.name}" swf="UserRegistration" />
    </target>
    the destination id is camp;
    the error is
    MessagingError message='Destination 'camp' either does not exist or the destination has no channels defined (and the application does not define any default channels.)']
    anyone can help me
    regards
    athi

    It turned out that my Captivate file exceeded 50MB (the
    working “.cp” file) and this causes problems when
    outputting, they tell me at Captivate support, that weird
    corruptions happen. I tried removing the audio from the Flash after
    synchronizing the audio to screen activity, then saving a non-audio
    version, then importing it into Captivate, then importing the audio
    into Captivate. Make sure to check Options/Synchronize to project
    when you import the .swf. That solved the problem for me. Good
    luck!
    Lorin

  • Capture all SQL statements and archive to file in real time

    Want to Capture all SQL statements and archive to file in real time?
    Oracle Session Manager is the tool just you need.
    Get it at http://www.wangz.net
    This tools monitor how connected sessions use database instance resources in real time. You can obtain an overview of session activity sorted by a statistic of your choosing. For any given session, you can then drill down for more detail. You can further customize the information you display by specifying manual or automatic data refresh, the rate of automatic refresh.
    In addition to these useful monitoring capabilities, OSM allows you to send LAN pop-up message to users of Oracle sessions.
    Features:
    --Capture all SQL statement text and archive to files in real time
    --Pinpoints problematic database sessions and displays detailed performance and resource consumption data.
    --Dynamically list sessions holding locks and other sessions who are waiting for.
    --Support to kill several selected sessions
    --Send LAN pop-up message to users of Oracle sessions
    --Gives hit/miss ratio for library cache,dictionary cache and buffer cache periodically,helps to tune memory
    --Export necessary data into file
    --Modify the dynamic system parameters on the fly
    --Syntax highlight for SQL statements
    --An overview of your current connected instance informaiton,such as Version, SGA,License,etc
    --Find out object according to File Id and Block Id
    Gudu Software
    http://www.wangz.net

    AnkitV wrote:
    Hi All
    I have 3 statements and I am writing some thing to a file using UTL_FILE.PUT_LINE after each statement is over. Each statement takes mentioned time to complete.
    I am opening file in append mode.
    statement1 (takes 2 mins)
    UTL_FILE.PUT_LINE
    statement2 (takes 5 mins)
    UTL_FILE.PUT_LINE
    statement3 (takes 10 mins)
    UTL_FILE.PUT_LINE
    I noticed that I am able to see contents written by UTL_FILE.PUT_LINE only after statement3 is over, not IMMEDIATELY after statement1 and statement2 are done ?
    Can anybody tell me if this is correct behavior or am I missing something here ?Calling procedure must terminate before data is actually written to the file.
    It is expected & correct behavior.

  • Change a state in main.mxml from a script in another mxml

    Hi,
    i'm having some trouble with my application, let's say i have the main application file called MAIN.MXML
    in wich i have set different States, and have different forms.
    now i have a form called loginForm which contains the textInput item for Login and Password, i also have a link Need to Register
    which onClick will change the state to show in the same panel a different form registerForm (with the relevant textInput items)
    now the MAIN.MXML includes a custom component called <comp: NetworkManager /> which includes all the logic scripts and MXML
    tags to create and manage an HTTPService request to a PHP Server.
    when the user click on the Login button, this will call a function included in the main.as script (imported in MAIN.MXML) which
    will call a function in the script within NetworkManager.MXML passing all the form data.
    in NetworkManager.MXML the script will create an XML message, will send to the PHP Server and wait the response... if this comes
    true the user is authenticated, otherwise is not.
    so far so good, i get the message sent, the correct response back. Now i want to hide the form in MAIN.MXML and put something like
    Welcome firstName lastName!! instead. But i don't know how to do it. If i try to access the states in MAIN.MXML from the NetworkManager.MXML
    i'll get all sort of errors which i don't have it here with me.
    I know this sounds like a newbie question, and it really is ... any taker?
    your help is much appreciated.
    thanks
    T.

    Hi,
    i've tried RemoveChild but i get an error like:
    ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
    at flash.display::DisplayObjectContainer/removeChild()
    at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::$removeChild()[C:\autobuild\3.2.0\frameworks\p rojects\framework\src\mx\core\UIComponent.as:5096]
    at mx.core::Container/removeChild()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\ core\Container.as:2274]
    at components::NetworkManager/sendUserAuthHandler()[C:\Documents and Settings\Tom\My Documents\flex_prj\Shoppy\src\components\NetworkManager.mxml:182]
    at components::NetworkManager/serverHandler()[C:\Documents and Settings\Tom\My Documents\flex_prj\Shoppy\src\components\NetworkManager.mxml:98]
    at components::NetworkManager/__serverRPC_result()[C:\Documents and Settings\Tom\My Documents\flex_prj\Shoppy\src\components\NetworkManager.mxml:290]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.rpc.http.mxml::HTTPService/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()[C:\autobuild\3.2.0\framewor ks\projects\rpc\src\mx\rpc\http\mxml\HTTPService.as:290]
    at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()[C:\autobuild\3.2.0\frameworks\ projects\rpc\src\mx\rpc\AbstractInvoker.as:193]
    at mx.rpc::Responder/result()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\Responde r.as:43]
    at mx.rpc::AsyncRequest/acknowledge()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\ AsyncRequest.as:74]
    at DirectHTTPMessageResponder/completeHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\s rc\mx\messaging\channels\DirectHTTPChannel.as:403]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()
    who is the caller of loginForm then? i've tried with Application.application.loginForm but i do get the same error though.
    loginForm is contained in a Canvas item, is it the caller? or who else?
    thanks
    T.

  • How to include components into mxml file?

    I have an mxml file with multiple states and it is getting
    quite large. I would like to divide these states into their own
    components. How can i include these into the mxml file?
    Thanks!

    I couldn't be happier that you asked this question and if you
    don't mind I'd like to extend on it a touch since it directly
    relates to my topic.
    I am right with Dr. Goomba (Great name) when it comes to
    filesize of a single application.
    The flash player has always been a big proponent of small
    file size and fast dowloads to ensure our users have a pleasant
    experience in our applications. I have been going through the
    documentation tirelessly and the only mention I really see as a
    supporter of that theory is "RSL" documentation which, believe it
    or not, actually advises against them unless you are using them
    across multiple apps.
    So, my question is a tack on to Dr. Goomba (Answer his first,
    this is just a supporter):
    Has Flex 2 moved us away from fast delivery? I have an
    application already up to 300k that could easily reach the 700k
    range (I think, based on my total progress so far) - It doesn't
    seem to me that the focus is still on loading things in parts like
    the MX 2004 RIA days.

  • Why must the number of states on all pages be equal?

    Hi,
    I'm building a complete interactive website in Fireworks CS5 using Master Pages, States and Behaviors for some neat interactivity on the mockup.
    My question is why must the number of states be equal on all pages? I have a Master Page with a simple rollover effect on all the links, but on the Profile page I have a popup where you can insert tags. To create an interactive popup on the Profile page I need a couple of states for that popup on the Profile page. As soon as I add more states to the Profile page it loses the content from the Master Page, even if I tell all the layers in the Master page to "share on all states", when forcing the Profile page get's disconnected from the Master page.
    There has to be a simpler way of doing this!
    Thanks!

    There is no way of doing what you want in Fireworks. It's not an HTML editor and can't generate more than rudimentary interactive objects. To create more sophisticated interactive objects you need have some knowledge of coding and use software like Dreamweaver or Flash.

  • Maximum number of events per audit log file must be greater than 0.

    BOE-XI (R2)
    Windows Server 2003
    Running AUDIT features on all services.
    Report Application Server (RAS) keeps giving the following error in the Windows Application Event Log.
    Maximum number of events per audit log file must be greater than 0.  Defaulting to 500.
    I am assuming that this is because the RAS is not being used by anyone at this time - and there is nothing in the local-audit-log to be copied to the AUDIT database.
    Is there any way to suppress this error...?
    Thanks in advance for the advice!

    A couple more reboots after applying service pack 3 seemed to fix the issue.
    Also had to go to IIS and set the BusinessObjects and CrystalEnterprise11 web sites to use ASP .NET 1.1 instead of 2.

  • IMP-00008: unrecognized statement in the export file, oracle 11gr2 on redhat 5

    I am using Oracle 11g R2 on Radhat 5 linux to import(imp) a dmp file with a table with blob data type. I got the following errors with binary non-ascii on the screen and failed imp at that table:
    IMP-00008: unrecognized statement in the export file: (a lot of non-ascii characters followed)
    How do that happen and how do we handle it?
    -Henry

    Hello,
    IMP-00008 may due to several reasons.
    The Dump may be corrupted, you may also hit a Bug and so on, ...
    Is it the only error you got or do you have other error message (for instance IMP-00032) ?
    Else, I don't know why you use EXP/IMP in 11.2, the Original Export/Import is not recommended. You should use DATAPUMP which is much more powerful.
    Please, find enclosed a link about DATAPUMP:
    http://www.oracle-base.com/articles/10g/oracle-data-pump-10g.php
    Hope this help.
    Best Regards,
    Jean-Valentin Lubiez

  • [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.

Maybe you are looking for