Flex :: Air - Implement Multiple View Components?

Aug 30, 2011

I'm developing a Flex/AIR application that's growing big, and some of the components need to be seen from different points of view (i.e Admin, Staff, User, Guest). I've seen myself placing code in those components to handle what the user can and can't see. But it's becoming unmanageable as the code and the roles grow bigger. I was wondering what's the best way to implement multiple views inside the components while keeping them as reusable as possible.

What I'm doing right now:

<mx:HBox width="100%" horizontalAlign="right" visible="{_view == TS_VIEW || _view == PRJ_VIEW}"
includeInLayout="{_view == TS_VIEW || _view == PRJ_VIEW}">
<mx:Button label="Agregar" click="button1_clickHandler(event)"
enabled="{_state != ADDING_STATE &amp;&amp; !_loading &amp;&amp; _canAdd}"/>
</mx:HBox>

View 2 Replies


Similar Posts:


Flex :: 4 - Implement A Custom Toolstrip For An App - Inherit Components?

Jul 1, 2010

I am new to Flex programming. I want to implement a custom toolstrip for an app. This tool strip will include a menu bar (or a customized equivalent) to display the common menu items such as File, Edit, etc as well as a search box. It should be flexible enough to include other menu items such as bookmarks, etc in the future. I have been thinking about mx:Group, s:BorderContainer, mx:HBox, but haven't been able to choose between them. And none of them seem espcially suited to my task as they merely specify layout of other objects. Is there any component which has direct support for such functionality. I have also thought about using mx:MenuBar but I don't know if it will be flexible enough to add non-menu items like search box.

View 2 Replies

Flex :: How To Implement Effects On Components Creation Or Removal

Oct 2, 2010

I have multiple MXML custom components that I add on the fly (using a repeater) that is binded to an ArrayCollection. So everytime I add/remove item from the ArrayColleciton new items show/disappear from the screen. Is there a straightforward way to make item fade in when they get created and fade out when they are removed? I thought of using states and state transition effects but that will make things a bit complicated at different part of my application for those components to manage the states.

View 1 Replies

Flex :: Components - Executing A Function On Another View?

Jun 5, 2011

I have a headerbar.mxml that is displayed when user swipes_down in my app. The headerbar.mxml contains a button component I want to run an erase() in the main application window. The main application is a drawing app that contains an erase(). I just don't know how to call a function from another mxml view file. I thought it would be something like

click="{mainwindow.drawPanel.erase()}";
EDIT:
protected function onColorChange(event:List):void{

[code]......

View 1 Replies

Flex 4 - Using RemoteObject And Multiple Components?

Aug 24, 2010

I was wondering what is considered to be a best practice when I have multiple components and use RemoteObject for AMF communication with a PHP backend.

Have the RemoteObject in the Main.mxml file with all the methods declared here (with handlers and all) and have all components call functions from the parentApplication, thus having a centralized result and fault handling, but making reusiability more difficult.Have a RemoteObject in each component with only the methods (and handlers) relevant to that component, thus making it easy to have clean, reusable components.

View 1 Replies

Flex :: Skinning Multiple UI Components?

Feb 2, 2011

Let's say you have a large number (N) of spark buttons in your app. Let's also say that your buttons all have very similar skins (size, various effects, etc) - the only difference being the specific png that they use as their BitmapImage. Do you end up with N skin files, all differing by 1 line? Or is there a smarter way to do this while not adding a lot of code when you create the buttons in MXML (in fact, ideally, none).

View 1 Replies

Actionscript 3 :: Flex - Tab View Multiple DataGrids And Same DataProvider

May 26, 2010

I have a flex application in which I have a TabNavigator with multiple tabs and a datagrid in each of those tabs. I have bound s single array of data to each grid.

What I want to do is to bind each grid with a particular set of data in that array i.e. to distribute array contents among grids based on data type. For example items starting with letter A could be displayed in first grid, B in second, starting with C in third and so on. Hence you can say alphabetically distribute the data on different grids. The problem is that the data will be added randomly by the user.

To make one data array for each grid is not an option (due to design restrictions).

View 2 Replies

Flex :: Datagrid Multiple Components In One Column?

Jun 24, 2009

I wanted to ask if there is a possibility to have both strings and radiobuttons in one column depending on the value of another column perhaps|column1 | column 2 | |r | radiobutton||s | string |If there is an r in column 1 in column2 should appear a radiobutton, otherwise column 2 just shows a string.

View 2 Replies

Flex :: Reuse A Single Function Across Multiple Components?

Aug 20, 2011

I have created a custom component that I am using, more conveniently, as a SkinnablePopUpContainer and I want to use the same function that calls and receives data from it for several Buttons in the UI. What is the best way to achieve this without having to create a new function for each button?

<fx:Script>
<![CDATA[
import spark.events.PopUpEvent;

[Code]....

View 2 Replies

Flex :: Flash Builder: Embedding The Same Asset In Multiple Components?

Dec 23, 2011

If I embed the same asset (i.e. image or sound file) in multiple components within a Flex Application, does the compiled swf contain the asset (and it's file size) only once or once for each time it is embedded?

View 1 Replies

Flex :: Structure Multiple Cairngorm MVC Projects That Share Several Components?

Jun 5, 2009

I recently completed a project for a custom report UI in Flex. Now, I've been tasked with creating a new application that is essentially a "lite" version of the original UI. It will include only a few of the options that are in the original application. Also, it needs to be a separate application.

I do not want to duplicate my code, so I am planning on moving a bunch of the classes from the original application to a new library that can be shared by both applications. However, I'm trying to figure out how to make this work in my MVC environment.

For example, I have an Accordion component that lets users filter several items. Each Accordion child is an instance of a custom component with two lists (one for entities available for selection, the other for the entities the user has selected). Each child component has properties bound to the Model and functions that call Cairngorm Events.[code]...

View 1 Replies

Actionscript 3 :: Updating View Spark.components.List?

Sep 23, 2010

I am using a List component inside an itemRenderer. The main user interaction involves dragging an item from the List in one renderer and dropping it in another. My problem: When the data object is updated I want the Lists' height to be modified according to the number of objects in the dataprovider(dp), which is passed to the List from the data object. Now I have tried to invalidate the display of the List, refresh its dp and have tried putting this line assets.length > 0 ? assetList.percentHeight = 100 : assetList.height = 10; in other event handlers, such as dragdrop handlers, collection event handlers for the dp etc. I have also tried refreshing the dp for the List component that is using this renderer. The view does eventually get updated but only if I resize the list, or use the scroller or when I begin dragging a new List item but never after the drop.

[Code]...

View 1 Replies

Flex :: Presentation Model Pattern Can View Specific Logic Reside In View?

Aug 15, 2011

I'm currently using RobotLegs with the Presentation Model pattern to develop a Flex 4 project. I understand that all business logic related to a View resides in the Presentation Model associated with that view, however, I am confused when it comes to View specific logic.For example, I have an indicator that needs to be positioned relatively to list items depending on which list item is selected. Is it acceptable in the Presentation pattern to put the logic that will position the indicator in the View and simply have that logic run in reaction to a selectedIndex property changing in the presentation model?The reason I am considering this is that since the Presentation Model does not have a reference to the view it is difficult to come up with an ideal solution for manipulating view components.

View 1 Replies

Flex :: Components - Components - Any Component With The Functionality Such As Horizontally Collapsible Window Or Panel

Aug 22, 2010

Do you know any flex component with the functionality such as horizontally collapsible window or panel I found arc90, but it folds vertically.

View 1 Replies

Flash :: Flex Dynamically Created Components Added To Custom Components

Sep 8, 2009

I am created a dynamically adding a VBox, that contains two images. Into a Custom Component that is derived from UIComponent. The problem is the Vbox that contains the two image is only a really tiny size. I would like the VBox stretch to the size of the two images. This is how I am creating the Vbox....

[Code]...

View 1 Replies

Flex :: Change A View From Inside A View?

Jun 13, 2010

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).

View 1 Replies

Flex :: Taken Push View Object Into Next View?

Sep 28, 2011

My problem is that when I try to pass an object from the navigator.pushView(view, dataobject), I can't figure out how to access the dataobject from actionscript. I can access {dataobject.property} from MXML easily, but I want to set a variable in the new view to the passed dataobjects property.

View 1 Replies

Is It Bad Design To Nest Components Inside Components Using Flex 4

Sep 15, 2010

Is it bad practice/design to nest components inside components using Flex 4? Should I simply be creating components and inserting them into my main application as below, or doesn't it matter?

<com:MyComp1>
<com:MyComp2>
<com:MyComp3>

[code]....

View 1 Replies

Actionscript 3 :: Require A Method Argument To Implement Multiple Interfaces?

May 4, 2010

The argument to my method func() must implement the two unrelated interfaces IFoo and IBar. Is there a better way of doing this than declaring another interface only for this purpose that inherits from IFoo and IBar and using that interface as the argument type?

[Code]...

View 2 Replies

View Hit Spots From Multiple Buttons

Nov 6, 2009

is there a way to view all of the hit spots with in the project at the same time? I have multiple hit spots attached to various buttons and it would be ideal to view them all at the same time to ensure I am not overlapping.

View 8 Replies

ActionScript 3.0 :: View Same Movieclip At Multiple Positions?

Feb 22, 2011

i want to have the same movieclip showing up multiple times at different locations on the screen. i don't want to create multiple instances just cuz it seems less "efficient", so it'd be neat if there's a way to do this.essentially what i'm trying to do is have a the user see the same movieclip but with different things on top of the movieclips, and if the user does something to do the movieclip in one location (ie: click to change a tile in the movieclip), i want that to take effect in all locations.i could just add event listeners to each tile in all the movieclip to have the same effect independent of which movieclip you click the tile in, but i'm hoping i can avoid this.

View 1 Replies

Actionscript 3 :: Design Pattern For Multiple View States?

May 27, 2011

I have an application that takes the user through a set of steps, configuring a product, say about 10+ screens. With options to go back, skip to a certain point etc. I need to fade between these steps, and also have language switches available at any point.

I was thinking of using an MVC style pattern, having a master view that accepts a 'next view' and fades it in, removing the old.

It feels bloated to have 10+ separate view classes, using similar components for this task, so was wondering what other approaches there are that I should look into? or one that is suited for this kind of application

View 2 Replies

ActionScript 3.0 :: How To Combine Multiple MVC Components

Jan 8, 2010

I am trying to understand how MVC works and have been able to build components using it. However, my understanding ends when I'm trying to combine these components into larger components. So for example I build a streetRacer class and it is composed of all the usual car parts and more. Inside my streetRacer class (which is considered the client in all of this, correct?) it would have parts like engine, tires, spoiler, etc. Now suppose the engine is created using MVC as are the tires and depending on the RPMs of the engine, that will change the speed at which the tires rotate. (I'm no mechanic and obviously this is highly simplified but I think it serves the example). Having said all that, how would the engine Model drive the tires to update it's view and model? Through the controller? And where would the relationship be set up? in the client?

View 0 Replies

Actionscript 3 :: Using Flash Components In Multiple SWC Files?

Feb 5, 2010

how do you properly handle namespace collisions in SWC files if one SWC has fewer classes from that namespace than another?I have a rather large Flash application which I'm building in Flash Builder (because coding/debugging in the Flash IDE is.not good) and I've got a ton of external SWC files which I'm linking in to my application. This has worked well so far - the file size is on the large side, but it's a lot simpler than loading in SWFs, especially since I am extending most of the classes in each SWC and adding custom code that way (it's a very design-heavy app.) The problem I'm having is when I have Flash Components, like ComboBox or TextInput, in more than one SWC. Whichever SWC was compiled last will work fine, but the others will fail with errors like the following:

TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::MovieClip@1f21adc1 to fl.controls.TextInput.
at flash.display::Sprite/constructChildren()
at flash.display::Sprite()

[code].....

I've been researching components, ComponentShim, etc. but I'm running up against a brick wall. I thought it might be the fact that some of the components had their skins modified in the source FLA, so I tried replacing them with the default skins. How can I ensure that I have the components imported and available to all my classes, yet still be able to skin them and include them in my various FLAs?

View 2 Replies

Flash :: Multiple Custom Components And The Display List?

Oct 18, 2011

I am using several instances of the same custom component on the same SWF. The component is essentially just a textfield with special sizing requirements. I also have another "wrapper" component that deals with the info from the textfield components. I was initially planning on using the stage index to associate the data with the textfield component it came from. This became more complicated than I anticipated. When I trace from the wrapper i can't get the index of the textfield components. So I got it in the component code and sent it with the info to the wrapper via a custom event. The problem there is that i can't tell which component is which because they are indexed identically. I can also see the component shim as well as the textfield.I'm just really confused about how programmatic components work on the display list.

My main Question. Is there a better way to associate the info with the proper component? I guess that's my only question. Please point me in the right direction.

EDIT2: I created a dummy place-holder component that just draws a rectangle then at runtime replaces it with programmatically generated textfield component.

View 1 Replies

Flex :: How Does One Implement The Google Maps 3D API (or Similar) For Flex With A Local Map Cache

Aug 17, 2010

I am writing a Flex application for use on a private intranet with no external Internet access. I want to use Google's 3D Maps Flex API, but it must be connected to the internet to download map tiles on demand.

Is there a way to locally cache the 3D map tiles and data so that I can run this app without an internet connection? And if not, is there a 3D GIS that supports Flex integration and allows for a local map cache?

View 1 Replies

ActionScript 3.0 :: Using Flash Components In Multiple SWCs Inside Only Project?

Feb 8, 2010

Ok, this is a somewhat complicated issue dealing with SWCs and compilers. I've outlined steps to reproduce the problem below. I'm using the method outlined here to bring in Flash content to my project. I have 15-20 SWCs already, and it's working fine for those assets, the problem is specifically related to Flash's components (ComboBox, RadioButton etc.) If anyone has *any* advice on this, please let me know as we are completely stumped at this point!
 
The issue we're having involves using multiple external SWC files which contain AS3 components from Flash CS4. When two SWCs are linked to an ActionScript project (using Flash Builder 4 Beta (build 4.0.0)) there are collisions in the referenced classes which cause the most recently published SWC to knock out any duplicate classes in the other SWCs. A simple way to replicate this is as follows:

[Code]...

View 3 Replies

ActionScript 2.0 :: Multiple Flash Components On HTML Page Communicating?

Oct 14, 2009

I'm setting up an HTML page that automatically starts playing a flash video. Well at the bottom of that page - is an area with testimonials thumbnails that the user can click on loading up a small flash video in that component. Is there a way to tell the main video to pause or restart or whatever so that I don't have two videos playing at once

View 7 Replies

ActionScript 2.0 :: Multiple Flash Components On HTML Page Communicating

Oct 14, 2009

I'm setting up an HTML page that automatically starts playing a flash video. Well at the bottom of that page - is an area with testimonials thumbnails that the user can click on loading up a small flash video in that component. Is there a way to tell the main video to pause or restart or whatever so that I don't have two videos playing at once?

View 1 Replies

Flex :: Use TweenLite To Implement Effect Of Flex's PopUpManager?

Apr 21, 2011

How can I use TweenLite to implement effect of Flex's PopUpManager?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved