Change state with MenuBar component

It's pretty easy to change the state with a button. Example:
click="currentState='AboutScreen'"
But when I try to do this on the MenuBar component, I'm not
having any luck. When I click on the item (let's say Help ->
About), nothing happens. My code is:
click="currentState='menu.student.create_profile'"
I also tried,
itemClick="currentState='menu.student.create_profile'"
No luck.. anyone know how to change states based off items
clicked from the MenuBar?

This should get you started:
http://www.playingwithfire.com/fun.html

Similar Messages

  • Change States with Hyperlink

    I would like to be able to change states in a Flex WindowedApplication by clicking on a RichEditableText hyperlink or some form of clickable text.  Is there a way to do this?  Thanks.

    Hi Bruyn,
    I didn't quite understand your page, but from your text it
    seems you want Spry URLUtils (
    http://labs.adobe.com/technologies/spry/samples/data_region/DataWithURLParams.html)
    I did both things on my page, notably on a gallery as well,
    even though it's much simpler than the one you have (
    http://www.cosmicollective.org/gallery.html?row=0).
    From there the gallery will automatically load the row
    fetched from the URL of the user's browser. You only need to edit
    the number on the link that corresponds to the data you want to
    display.
    Cheers,
    Tomas

  • Changing states with actionScript

    Hi,
    I have some states set up in my app using MXML as per the
    script sample below. This is of course very handy, but upon
    changing from one state to another I want to include some
    actionScript to make a few things happen when the state changes. I
    know that I have full control over states in AS but can I set up
    the states as below using MXML and then use AS just to perform the
    change. Currently, selecting a new item in a dataGrid calls the
    change (change="currentState='editProperty'") but I'd prefer to
    have this (change="editProperty()") which would call an AS function
    to do some work and *then* change the state. Any help appreciated
    as usual,
    <!-- States -->
    <mx:states>
    <!-- Edit property state (multipage form)-->
    <mx:State name="editProperty">
    <mx:SetProperty target="{props}" name="height"
    value="262"/>
    <mx:SetProperty target="{props}" name="x"/>
    <mx:AddChild position="lastChild">
    <mx:VBox width="100%" height="100%">
    -- various controls etc. here --
    </mx:VBox>
    </mx:AddChild>
    </mx:State>
    </mx:states>
    cheers,
    Mike

    You could write an actionscript method which takes any class
    that extends UIComponent. This includes Application, Canvas, Panel,
    etc...
    All have a current state
    I actually have some code which does just that
    package com.domain.ecommerce.admin
    import mx.events.ItemClickEvent;
    import mx.controls.Alert;
    import mx.core.UIComponent;
    public class StateManager
    * changes the current state based on anything that will
    generate an ItemClickEvent...
    * For exmaple: <mx:LinkBar
    itemClick="StateManager.chooseState(targetComponent,event)" >
    ... </mx:LinkBar>
    * note: this is the object the link bar is located in ...
    public static function chooseState(component:UIComponent,
    event:ItemClickEvent) : void {
    component.currentState = event.label;
    public static function
    chooseStateByString(component:UIComponent, newState:String) : void
    component.currentState = newState;
    You can do something like :
    click="StateManager.chooseStateByString(this, 'newState');"

  • Change state with timer as well as with mouse click?

    I would like to set up an image with two states, "State 1" and "State 2"
    I would like the button to toggle between "State 1" and "State 2" onMouseDown.
    But I would also like the button to alternate between "State 1" and "State 2" on its own every 3 seconds.
    Can you tell me how to set this up?

    This should get you started:
    http://www.playingwithfire.com/fun.html

  • Can I change state with textfield?

    Hello Everyone,
    I would like to be able to change a state as soon as the user
    types some thing in a text field. I have the change event wired up
    the text field. I am able to show Alert box whenever the text filed
    gets click. But when I set state to be loaded, I am unable to load
    the state.
    Can you guys help me, please.

    got it working:
    this.currentState = 'xxx';

  • Changing states with a timer?

    Does Flex support any state changes based on a timer? I can't find anything online about this.

    Setup the Timer something like this...
       import flash.utils.Timer;
       import flash.events.TimerEvent;
       // create a timer which fires every second (1000 ms)
       var timer:Timer = new Timer( 1000 );
      // add a listener to the timer
       timer.addEventListener( TimerEvent.TIMER, handleTimerEvent );
       // start the timer
       timer.start();
    Then change the state in the timer event handler...
       public function handleTimerEvent( event:TimerEvent ):void
           this.currentState = "nextState";
    Does that help?
    Ben Edwards

  • Changing states from within a component

    Let's say that I have a TileList that is rendering data in a
    VBox. Eventually the TileList fills up and starts scrolling. I want
    to change states when clicking on item in the TileList.
    I don't want to place the click-attribute in the TileList,
    because it will change states when I am scrolling the list without
    actually selecting anything.
    I want to say click="currentState='state2'" inside the VBox,
    but that does not work because state2 is at the root level, and I
    don't know how to get to the root-level (in lack of a better word)
    from withing the component.
    This is not the proper syntax, so misunderstand me the right
    way here... Is there an equivallence to
    click="currentState='_root.state2'" in mxml?
    Thanks for any suggestions or best practices. I want the easy
    way out.
    This is the general structure...
    <mx:Application>
    <mx:states>
    <mx:State id="state1"/>
    <mx:State id="state2"/>
    <mx:State id="state3"/>
    </mx:states>
    <mx:TileList dataprovider="{...}">
    <mx:itemRenderer>
    <mx:component>
    <mx:VBox id="ClickThisBoxToChangeStates">
    <mx:Image/>
    <mx:Label/>
    </mx:Vbox>
    </mx:component>
    </mx:itemRenderer>
    </mx:TileList>
    </mx:Application>

    Your assumption is right.
    It doesn't work because there is no state2-state defined
    within the mx:component.
    In the documentation about changing states it says that I can
    go from application level and change states within a component;
    like this: click="currentState='mycomponent.anotherstate'" but not
    how I can change a state at application level from within a state.
    When I try, it says (at runtime) that the state is not defined.
    So I don't know why <mx:VBox
    click="currentState='state2'"/> doesn't work.
    I apprechiate your expertese a lot.

  • Is it possible to change application state from a component?

    I was wondering if it is possible to change application state from within a custom component and if so, what would the syntax be if I had an application named "zzz" and I wanted to change the app state from "state1" to "state2" from my component?
    Thanks!

    Hi,
    you always have a static class Application.
    Application.application will be the root component. After that you can change it state.
    Application.application.currentState = "state2";
    But it's not the best way to change states. It's better to dispatch events from components and change states in listeners.

  • PSD Rollover Button with image in front stops button from changing state

    I have a wide PSD button that changes state when rolled over. I would like to place a PNG image with transparency in some areas over the top of it so that the rollover button shows through the transparent areas of the PNG.
    How can you get it to do the rollover effect when the user mouses over the bit of the button that the image is in front of? Is ther a way of making the PNG 'invisible' to the mouse?
    I know I could redesign the button so that it includes the image but I'm trying to keep file sizes and load times to a minimum, I use this button a lot on my website with a different on each, and having that number of individual buttons would result in a bloated, slow-loading website.

    Hi Abhishek
    Thanks for your reply. I was able to achieve the effect I wanted by having the PNG and the PSD Button with the same link and then grouping them. This means I can mouse over the PNG and still get the PSD rollover effect, which is perfect.
    However I also have another similar problem. I have some different PSD Rollover Buttons which have some text in front of them (basically it's the button label). On some of these buttons when you roll over the text it prevents the rollover state of the button, and on other buttons the rollover effect occurs as it should, and there doesn't appear to be any consistency about which does what. Grouping or ungrouping doesn't appear to make a difference. Can you help?

  • Changing state of application from within a custom component

    Hello, I have several custom components all of which are included in the parent application.
    When I try to change state from a custom component, I get an error  saying "undefined state: state name". How do I change the state of the  application from within a custom component ? All the states are defined in the parent application.

    @linrsvp,
    If you are using Flex3 try Application.application.currentState = "somestate";
    If you are using Flex4 try FlexGlobas.topLevelApplication.currentState = "somestate";
    Don't forget to import the corresponding namespaces for the above.
    Thanks,
    Bhasker

  • Change States in component from main view

    The scenario like this:
    The main view includes many component views. On my main view
    there have a radio button to choice different role type, for
    example: admin and user. For different role have different views.
    But they don’t have big difference.
    My question is how could I implement my component view change
    states when I click button on the main view? I don’t want do
    change states in main view since I need create two component views
    for different roles.
    Thanks.

    Consider adding a second state to your application, even if
    you don't put anything into it.
    In each of the components that should change state when the
    role is changed, add a listener on the application for the state
    change event ("currentStateChange"). When this event is fired,
    query the application for its current state:
    var appState:String = (Application.application as
    Application).currentState;
    Use that to change the state of the component. Remember
    you'll also need to do this when your component is first
    created.

  • Change the Production state of Software Component in SLD

    Hello,
    I cannot see the list of software component to add in Dev Configuration because the Production State of software component is in Planned state and to appear in the list it should be in Devlopment state.
    How do I change the state. When I login to SLD i dont see the edit mode to change it.
    Thanks
    PS: I did not realize there is separate NWDI forum.  I also asked the same question in Web Dynpro forum.

    Hi,
    if the question is about, why the custom developed software is not visible in "CMS - Landscape Configurator - Track Data tab" when pressing the button "Add SC...", then please answer:
    Did you trigger "Update CMS" after creating the software in SLD? You can do it in the CMS webui - Landscape Config - Domain Data tab.
    Best Regards,
    Ervin (http://wiki.sdn.sap.com/wiki/display/TechTSG/%28NWDI%29Home)

  • Menubar component and xml issue

    Hi folks,
    I am using the menuBar component that ships with mx2004pro,
    to choose galleries in an xml gallery. The gallery selector code is
    this:
    It's the second to last line, bassmenu.childNodes.onRelease =
    function, that I am having trouble with. bassmenu is the instance
    name of the component. The menubar component is loading the xml
    just fine. If I change the above to "bassmenu.onRelease =
    function..." the top level buttons on the bar will change the
    gallery. I just can't figure out how to address the child nodes of
    the menubar.
    I have spent a ridiculous amount of time on this, bought and
    read a book, read every tutorial and help file out there, any help
    would be greatly appreciated. I would be happy to post the source
    and the xml if that helps.

    The documentation is wrong.  Your payload should include the commands you want to deploy.  So, use:
       cwcli config import -u admin -p [Base64PWD] -device [DisplayName]
       -f
      interface FastEthernet0/21
      switchport access vlan 2400
      switchport mode access
      no cdp enable
      spanning-tree portfast
      ip verify source
      shutdown
    end

  • Customising the "bar" of the MenuBar component

    Hi there, here is my situation...
    I'm trying to modify the style properties of a MenuBar
    component at runtime, in particular the colour of the bar.
    Reskinning is not really an option as the effect must happen
    at runtime.
    Using
    myMenuBar_mb.setStyle("themeColor", 0xFFAAAA);
    works to an extent (changing border & highlight colour)
    but does not change the silvery bar that the "root menu" labels sit
    upon.
    if I use setStyle("backgroundColor", 0x000000); the child
    Menu's are changed, but alas, not the bar itself.
    Any ideas?

    Well in the case of only searching a specific field all you need to do is delete the portions of your reports SQL statement that are refering to the other columns.
    find the regions area in your edit page
    select the first link in the line about your report (the name of your report as oppossed to the one next to it that says report)
    scroll down to the source area there should be a SQL statement that looks something like this:
    SELECT * FROM
    (SELECT NAME, ADDRESS, PHONE_NUMBER
    FROM TABLENAME)
    WHERE (
    instr(upper("NAME"),upper(nvl(:P3_REPORT_SEARCH,"NAME"))) > 0 or
    instr(upper("ADDRESS"),upper(nvl(:P3_REPORT_SEARCH,"ADDRESS"))) > 0 or
    instr(upper("PHONE_NUMBER"),upper(nvl(:P3_REPORT_SEARCH,"PHONE_NUMBER"))) > 0
    the instr statements return true if at least one instance of the search value is in in that column so in order to not include Address and Phone_number just get rid of those lines.
    SELECT * FROM
    (SELECT NAME, ADDRESS, PHONE_NUMBER
    FROM TABLENAME)
    WHERE (
    instr(upper("NAME"),upper(nvl(:P3_REPORT_SEARCH,"NAME"))) > 0
    Delete them and apply changes.
    The next thing is to get rid of the highlights (instances of the search string turn red in the report)
    Click on the second link (report) for your report region.
    click the edit icon next to address
    in Column Formatting delete the text in Highlight Words.
    apply and repeat for phone_number

  • Flex List ItemRenderer : Change States from parent ?

    Hai there,
    So i created a list that uses an arrayCollection as dataProvider and an itemRenderer with 2 states : LabelState and ProgressState, the labelState is the start state and shows a Filename, the progressState is the state i need to change to when i press a "Start Upload" Button.
    This is the itemrenderer :
    <?xml version="1.0" encoding="utf-8"?>
    <s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    autoDrawBackground="true" currentState="LabelState" width="800">
    <s:states>
    <s:State name="LabelState" />
    <s:State name="ProgressState" />
    </s:states>
    <fx:Declarations>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <fx:Script>
    <![CDATA[
    public function changeState():void
    trace("changing state for " + label_field.text);
    this.currentState = "ProgressState";
    trace(this.currentState);
    ]]>
    </fx:Script>
    <s:Label name="label_field" paddingLeft="10" maxHeight="40" paddingTop="10" paddingBottom="10" id="label_field" width="800" color="#333333" includeIn="LabelState" text="{data.label}"/>
    <mx:ProgressBar id="progress_field" left="3" top="3" bottom="3" mode="manual" chromeColor="#0096FF" includeIn="ProgressState" textAlign="center" labelPlacement="center" maximum="100" color="#FFFFFF" right="3"/>
    </s:ItemRenderer>
    This is the code for the List :
    <s:List keyUp="lst_selected_files_keyUpHandler(event)" skinClass="styles.skins.ListSkinNoHorizontal"
    borderVisible="false"
    contentBackgroundColor="#c9c9c9" contentBackgroundAlpha="1"
    id="lst_selected_files"
    width="100%" height="100%"
    alternatingItemColors="[#EAEAEA,#FAFAFA]" color="#000000"
    itemRenderer="components.ProgressLabel" dataProvider="{arr_items}" />
    <components:RemoveBar nr_of_items="{arr_items.length}" id="cmp_removeBar" hermesRYA="cmp_removeBar_hermesRYAHandler(event)" bottom="-35" width="100%" height="35" />
    This is the function that changes the states for the current "to be uploaded file":
    protected function uploadNextFile():void
    if(uploadingFile!=null) uploadingFile==null;
    popup = null;
    popup = new ProgressPanel();
    lst_selected_files.selectedIndex = currentUploadNr;
    current_progressItem = lst_selected_files.dataGroup.getElementAt(currentUploadNr) as ProgressLabel;
    current_progressItem.changeState();
    lst_selected_files.validateNow();
    For some reason the states change ... but the elements aren't visually updated, ... meaning that i still see the label and the progressbar isn't visible :/
    anyone ?

    This seems to work for me:
    <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" >
        <s:controlBarContent>
            <s:Button label="test" click="(list1.dataGroup.getElementAt(0) as Object).test()" />
        </s:controlBarContent>
        <s:List id="list1">
            <s:dataProvider>
                <s:ArrayList>
                    <fx:Array>
                        [0,1,2]
                    </fx:Array>
                </s:ArrayList>
            </s:dataProvider>
            <s:itemRenderer>
                <fx:Component>
                    <s:ItemRenderer>
                        <fx:Script>
                            <![CDATA[
                                public function test():void {
                                    currentState = 'state2';
                            ]]>
                        </fx:Script>
                        <s:states>
                            <s:State name="state1" />
                            <s:State name="state2" />
                        </s:states>
                        <s:Rect width="50" height="50">
                           <s:fill>
                               <s:SolidColor color.state1="red" color.state2="green" />
                           </s:fill>
                        </s:Rect>
                        <mx:ProgressBar includeIn="state2" />
                    </s:ItemRenderer>
                </fx:Component>
            </s:itemRenderer>
        </s:List>
    </s:Application>
    You will probably want to override getCurrentRendererState() to do this properly tho.  This post demonstrates how to use DataRenderer instead if you would rather: http://flexponential.com/2010/02/07/using-datarenderer-to-add-custom-states-to-a-spark-lis t-renderer/
    In general you shouldn't interact with the renderers of a List directly (via getElementAt), but rather by changing the data in the List and building an ItemRenderer that reacts to those changes.  So it would be better if you did something like list1.dataProvider.getItemAt(0).changeState = true and then in your renderer override the data setter to change the state if that variable is set.

Maybe you are looking for

  • How do I locate a shared hard drive on my personal wireless network?

    I would like to access a drive that my husband and I share over our wireless network. However, I am not sure how to prompt my Macbook Pro to look for the drive. In 'Finder' the shared drive doesn't show up under my available devices, even though I kn

  • Why can't I drag a single song to an album in itunes 10.5.2

    I have an album with 12 tracks in it but the Number 1 track some how got left out. Now I'm trying to drag it to the Album in album view but it won't go in.  I also went to get info and told it was a compulation and re-named everything to match and it

  • HT204053 Please check my apple ID

    Please check my apple ID It can't use to buy thing in app store Please help me as soon as you can

  • How to sync pdf  files without deleting existing ones

    Hello Everyone, I am new to the apple world and i recently bought an iphone 5 and an ipad mini. i am loving using them but i am facing a problem everytime i try to sync media. whenever i upload new stuff its automatically deleting the existing stuff.

  • Possible Safari wildcard SSL issue

    I really hope this is the right venue for this sort of thing. This is my first post here, so please forgive me if this is not the place. That said, I think that I have run into an issue with the way that wildcard SSL is handled in Safari. I have an S