Flex :: Change The List ItemRender Depends Of The View State
Jan 11, 2011
I have one list, which the item render it`s like this:link. But now I need to enable or disable the button delete depends the view state which my List is inside. This is my view(which contains the list):
I am learning Flex and trying to make a simple RPG to practice. I am using view states to change between screens. right now I have a HomeView.mxml which displays my character information, InventoryView.mxml which shows my inventory items, and EquipmentView.mxml which shows the equipped items. They each have their respective view states.
in my main mxml file, i create a global variable for the character and an ArrayCollection of items in the game. it creates 2 labels in mxml for Inventory and Equipment and when i click on the label it calls a click handler which sets currentState="EquipmentView" or "InventoryView" This works and the state changes and the respective views are shown properly. My problem is in my EquipmentView state. When i enter the state the first time, it has a creationComplete function which displays images for my equipment and sets a click handler. when i click the item, it "unequips" it and removes it from the equipment list and removes the image. this also works fine, but when I go to my inventory view and "equip" an item and return to the EquipmentView, the image does not show. I have a label which counts the length of my equipmentList variable and that is accurate when i switch views, but i cant get the image to display again. Is there a way to call my displayEquippedItems() function (which is originally called on creationComplete) when the view is changed?
In Flex 4 (beta 2), I have a list control populated from an XMLListCollection. What I would like to do is when an item is selected in the list, use a custom item renderer on the selected item as well as the item that appears just prior to the selected item in the list.
I am using a spark list control, but I am open to alternate components if the solution makes sense.Here is the strucutre of the xml used to populate the XMLListCollection
I have a Flex List which is databound to a Array. My problem is that when I reorder the List using the built in dragMoveEnabled, the values are reset to the original values.I assume I need to somehow do a two-way databinding but I am not sure how.
i want to create a sine wave and its speed will change depends on change in freequency and wavelength . and stop the wave movement when we click stop button.[code]
I have decided to go the route of using ViewNavigator and having one view with 3 states. Each state is a "page". It runs just fine on the desktop but when compiled for mobile, the transitions between the pages is really laggy, even for the Samsung Galaxy S. The phone has the 2.7 runtime and I recompiled my application with ADT 2.7, still no performance increase.
I have also tried cacheAsBitmapMatrix on all 3 pages, which are all contained in a VBox and that hasn't shown any significant performance bumps. All I'm changing is the y component of the VBox for each transition.
EDIT: I have done some more research and I am now to the point where I have hardware acceleration turned on and cacheAsBitmap = true and cacheAsBitmapMatrix = new Matrix(). I am also using Stats.as to see the FPS. I notice on my state changes I go from 25 FPS to 2 and then it goes back up again.
I have one .mxml file (the Application) with a ViewStack (with 4 views) and a ControlBard, obviously I can change the views with it, but what I want to do is: in view #1 I have an image which I want to convert to a "hyperlink", so when I click it I go to View #2, is this doable? Also I would like to pass somehow some data (like a String) to that View #2 (lets say the it's a user avatar I click so I want to go to the second view which will show me his profile, that's why I need his name/id).
In Flex Builder 3, I am trying to access the main applications view state from within a component.On initialize I show the Loginpage-component. When I click the login button I want to hide the loginpage and show my "controlpanel" page, which also is a component.I try with this, and also placing this function in the main application.[code]
my problem is when i create a button in state 1 and click on it according to code it should make a group in another state named as expand. However according to my code it is still making group in current state 1.
I am currently updating page level "visited=true" programatically/runtime. I wanted to roll up to topic level(all parent levels) once I have shown visited state "true" to all pages in topic.
I've got a whole bunch of data being displayed in different Labels, now I'm adding an edit state. I'd like all the labels to "transform" into TextInputs. I was just wondering if it possible to uses states to change
We have a requirement to show a list of appointment slots. So every hour of a schedule has a set of 10 min slots. The requirement is that if we click on a arrow button at the 8:00, 9:00 hour slot, the layout of the hour slots should change from a vertical list to a horizontal list.For this we modeled the system as follows:ScheduleComponent ->(contains) -> List (Hours of schedule)The HourViewComponent is an Item Renderer, that displays the 10 mins slots based on the available appointments by using a Slots List (list of slots in the 8:00 hour). For the Slots List we have a Slot View Component as an Item Renderer.Now the issue is that when we click on the 8:00 slot we are able to change the HourViewSlot from a VerticalState to a Horizontal state. But The container height is not collapsing in the minimized state. It occupies the same size as the vertical layout! We tried using variableRowHeight attribute.
I have a button with a click event of "currentState='someState'". Is there a way to tell component to do some function like for example "Function()" when the state changes to "someState"? So execute a function when the state is changed.
I currently use: Flexglobals.toplevelapplication.component1.compnent2.currentState = 'something';is there a better way of doing do? Can I bind the state of a components to variable in my model?
I can do this: <s:Button id="Btn" enabled.State1="false" /> But the following code is giving me an error. private function enableDisable():void{ Btn.enabled.State1="false"; //Error: Access of undefined property State1 } How to code enabled.State1 in ActionScript?
I am trying to use a combobox in flex with an array to change to a canvas in a view stack. Can I do this with some custom action script? The UI I am designing could really benefit form this.
I want to implement this script: [URL]...that is doing this "magic [URL]
...but I want to tweak it a little on InfoWindowTabbedComponent. To be more precisely I`m trying to insert links in that tabs, and when you click one the state will change.
You can see my custom InfoWindowTabbedComponent at the end of the post As you can see, right now I have 2 functions that open url`s.
What I`m trying to do is to change this:
var adobeURL:URLRequest = new URLRequest("http://www.microsoft.com" ); navigateToURL(adobeURL, "_self");
For my custom components, when they go from enabled to disabled or disabled to enabled, I want to trigger a custom event. I can't find any related events in the livedocs.
I don't know if this is too difficult or too easy. My custom component is trying to listen to the main application's state changes using StateChangeEvent.CURRENT_STATE_CHANGE, but it's reporting its own state changes.
I've found a very annoying problem with the itemRenderers in a DataGroup in flex 4, when I mouseout of the itemRenderer is returns to its default state. Here's an example:
When the user clicks on the button the VGroup is collapsed as expected, but then if a user moves their mouse out of the item renderer it then collapses, i.e. returns to its default state.
I have three columns and the default visible state of last column is false.My problem is how can I change the visible state of the certain cell while the mouse over any part of the row
I have a custom component ExpandCollapseMenu that extends SkinnableContainer.This component can have state "normal" or "expanded".Inside this component I have buttons, with different skin based on ExpandCollapseMenu's state.This works fine when defining the buttons inside ExpandCollapsMenu's skin class:
I am learning Flex and have an image I would like to changed on mouseover, and switch to another state on click.I do not want to use any of the buttons available in Flex.Does anyone know th code to achiev what I want?