Actionscript 3 :: Creating An API For A View Component In PureMVC?

May 8, 2010

In the context of AS3 and specifically a framework such as PureMVC, what an API for a View Component means.

View 2 Replies


Similar Posts:


Flex :: Mediator Must Hold View In PureMVC?

Dec 28, 2009

I have one question about pureMvc. I use pureMvc to build an engine, in the engine init part i have an requirement

1) moduleA must init firt
2) moduleB , moduleC need init after moduleA init complate.
3) moduleD need init after moduleB & moduleC init complate.
4) moduleA , moduleB , moduleC , moduleD all extends Proxy beacuse the four system all need to send notifiation ,but no need to listen it.

But to fit for the requirement I can't use command to do it, because they have ini order and also they need to remember current state(ex: moudelB is init Complate but moudleC is not init complete then can't init moudleD) but command is stateless. The best way I think is use one Mediator to do it, beacuse it can both listen and send notification. My question is :

1) Is this a good way to use one Mediator to do it?
2) If use Mediator is good way, then when it hear first moduleA is init complate
registerCommand(FIRST_MODULE_INIT_COMPLATE , initStepTwoCommand);
sendNotification(FIRST_MODULE_INIT_COMPLATE);
removeCommand(FIRST_MODULE_INIT_COMPLATE);
Need to do things like that way or just do the inti logic in the Mediator?

View 1 Replies

Flex :: Creating RobotLegs Module Within A PureMVC Shell Application

Oct 19, 2010

I'm working on an existing modular project that was built in PureMVC. Instead of converting everything over to RobotLegs, I want to create a new module using RobotLegs and plug it into the pureMVC shell. Currently, when the module loads, I get the following flash error: ReferenceError: Error #1065: Variable IMediatorMap is not defined.

Inititally, I thought it was because my module needed a pureMVC Mediator to call the pureMVC StartupCommand to get things "hooked up" and THEN create the RobotLegs' Context. However, that didn't work and I'm still getting the error.

View 2 Replies

Flex :: Make A Custom Component Or Extend The List Component For A 2D Top Down View MAP ?

Nov 11, 2010

I'm building a top view 2D map, that it's objects are stored on the server.The kind of objects are 10 and might be a photo, label, button, lists, mix of them or labels with tooltips.The component must request the "areas" that are missing on screen.An area is 1000x1000 px and is cached in flex.To move in the map, will be like in google maps (drag-and-drop).I should be able to have another list and move objects from one to another using drag-an-drop on objects. Ex.: I grab an objects from a list and I move it on this map, I release the mouse button and the item is placed there.Now the problem is: I build a custom component for this trying to emulate the item renderer for performance and recyclage, implement drag-and-drop on objects and request the areas that are missing?

or

I extend the List component from spark and I add some features as multiple kind of itemrenderers and use recycle on them. Of course it must be able to request the missing areas on the screen and cache it's data.Maybe create a custom layout is needed too.What I need is something that must be really fluid, so the lighter this component is, the better.

UPDATE: *There will be not any object over another.

*I will not use hitTest on bitmaps because all bitmaps are wrapped in another component,as they,for now are itemrenderers.

Anyway I already begin to do this using a class that extends the SkinnableDataContainer and a custom layout. As the layout is not like a grid, is sparse, random items at diferent points(x, y).How to get the localX and localY, relative to item renderer and not to the Spark List, from a DragEvent in Flex 4?

View 1 Replies

Put Scroll Of Tree Component In Left Side Of Component Or Creating A Custom Scrollbar For Tree Component

May 20, 2009

is there any way to put scroll of tree component in left side of component or creating a custom scrollbar for tree component

View 13 Replies

Actionscript 3 :: Recursive Flex View Component?

Sep 15, 2011

I have a Flex component that is a view of a data Object that recursively has a reference to itself.

For example if you had an Employee class that references a boss field of type Person, I'd like to nest the same view for that Boss. This shouldn't be an infinite recursive relationship (e.g. I'd only be viewing the boss field of each object).

I've tried creating an MXML component that references itself but when I run it locks up (seems like it gets into a recursive loop).

Is there anything you can do like includeInLayout conditions that will make sure it doesn't even instantiate that component.

View 3 Replies

IDE :: FLV Player Component - Click To View Fullscreen?

Jan 14, 2009

So I'm building a flash presentation and one slide has video. I have a flv component on the stage and the user wants the video to initially appear at a smaller size and then to click on it to launch the movie in fullscreen and to play. The playing is no problem but it doesn't want to launch fullscreen.Code below:

// VIDEO
moviePlayer_mc.fullScreenTakeOver = false;
moviePlayer_mc.addEventListener(MouseEvent.CLICK, launchFullScreen);

[code].....

View 9 Replies

ActionScript 3.0 :: Component To Allow Viewers To Scroll And View Text?

Jun 5, 2010

i need help using the list component for my text in animation. i want the component to allow viewers to scroll and view text.

View 10 Replies

Flex :: Scroller - How To Bring Contained Component Into View

Aug 28, 2009

I have lots of child text inputs within a spark Scroller. How can I make the TextInput with id of "x" come into focus if I have a..z id's, also for the scrollbar to scroll automatically to that child item? I can use x.setFocus(), but the scrollbar doesn't automatically scroll to that item? why?

<s:Scroller id="scroller" width="100%" height="100">
<s:Group id="group" width="100%" height="100" id="content">
<s:TextInput id="a" text="" editable="true" width="100%" height="25" />
<s:TextInput id="b" text="" editable="true" width="100%" height="25" />
....
</s:Group>
</s:Scroller>

View 3 Replies

Flex :: RichEditableText Component Not Completely Resetting Its View

Mar 1, 2011

I'm experiencing some strange text rendering behavior in the Spark RichEditableText component.

<?xml version="1.0" encoding="utf-8"?>
<s:Application
xmlns:fx="[URL]"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
[Code] .....

The above application simply navigates through the five sentences in the DATA array (every time the Next button is pressed). For whatever reason, RichEditableText component doesn't completely reset its view (by clearing the previous text) before setting new content. From what I can gather, this faulty rendering is somehow based on the combination of line count and relative width. I also discovered that if I set the width property of the RichEditableText component to an absolute value (say, 100) as opposed to relative (percentage, 100%) the text is rendered correctly. As far as I can see, this behavior is unintended and is, in fact, a bug.

View 1 Replies

Actionscript 3 :: Refer To A Spark View Component In Code?

Nov 12, 2011

I'm building a mobile AIR app using Flash Builder 4.5. The initial view in my views package is TestHomeView.mxml. I want to refer to it in one of my .as classes elsewhere in the app, and I'm not sure how to do that.

Theoretically I should be able to add an "id" attribute to TestHomeView.mxml, but FB gives me an error: "id is not allowed on the root tag of a component". The root tag is s:view.

The reason I need to do this is that within another class I make various calculations and then need to pass an array of values to a component in my view class. So in SomeOtherActionScriptClass.as I first assemble the array, myArray, and then in that class I want to do this:

myViewComponent.viewArray = myArray;

If I'm going to do that, I also need to import the view class into the .as class, which strikes me as weird. So is there a simple way to do what I want, or do I have to dispatch a custom event which contains the array, and listen for it in the view class?

EDIT - Based on the below MVC suggestion I did the following in model:

[Bindable]
public class Model
{
private static var myModel:Model;//doesn't let me name it 'model' because

[code].....

But it is coming back null. It isn't null when I put a breakpoint in the Model class, but when I try to access it from the view class, it's null. The model itself isn't null, but that variable is.

View 2 Replies

Flex :: Determine Which (custom) Component In A View Currently Has Focus

Nov 28, 2011

I'm currently building a Flex 4.5 mobile project including several views and custom written MXML components that can be incorporated dynamically into those views.How do I determine which component currently has focus, namely has been activated by the user tapping on it? The background for this is a global search function in the main application. Depending on the results of this search, fields in the custom components are set. Given that I don't want all components in a view to listen to the outcome of that search function, I have to check which one is currently active.I'm trying to bind the selected object (the result from the search function) to the active component.

View 1 Replies

Flex :: Place A Tooltip On The Left Side Of A Component On View

Feb 19, 2010

Let's say I'm trying to place a tooltip on the left side of a component on my view. Layout may look similar to this:

[CODE]...

After the point is converted via contentToGlobal(), the point's x coordinate is drastically incorrect. I've found a way to workaround this by simply wrapping the target component in another HBox like this:

[CODE]....

View 1 Replies

Flex :: Eliminating The Folder Icon Of A Tree View Component

Apr 18, 2011

does anyone knows how i could just eliminate the folder icon of a tree control and display only the leaf? supposing i have an xml structure looking this :

[Code]...

View 1 Replies

ActionScript 3.0 :: Flex Accessing Applications View State From Component?

Sep 26, 2009

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]

View 1 Replies

Actionscript 3 :: Custom Flex Component, Visual Controls In Design View?

Apr 1, 2010

Do you know how if you drag an <mx:Label> or <s:Label> component into your Flex project, when you go to design mode you get this panel on the right to set its properties like text etc.

I have a custom component that I can call with actionscript, or with mxml like this:

<comps:TheComp field1="OK" field2="Yes" />

The component takes this input and uses it for its internal operation

[Code]...

When I go to design mode, I can see the component under custom components, I can drag it to the stage and see it, but can't set its values field1 and field visually on the right like a normal <s:Label> or <mx:Label> would have. how I can add that? Do I need to make it inherit something or anything else

View 3 Replies

Flex :: Hero Spark Component - Changing View From Within Custom Itemrenderer?

Mar 22, 2011

I've made a custom list itemRenderer with 2 buttons and a label. One button deletes the list entry (and thats not the problem) the second button would change the actual view.how I can change actual view within the itemrenderer ?

View 1 Replies

Flex :: Run ClickHandlers On Buttons Moved From Main View Component To Header Bar?

Jun 7, 2011

I've used JRab's example here [URL]... to add a header menu to my app. What I'm having trouble with is executing my functions from the header mennu. For example, my firstView is appHome.mxml. It instantiates a Canvas object that has an erase(). There is a button in appHope.mxml that executes the erase() on the Canvas instance. I'm trying move the Erase button out of my appHome.mxml and into my headerMenu.mxml but don't know how to execute the erase() on the Canvas instance. The first thing I thought to try was click="{appHome.myCanvas.erase()}" but obviously that didn't work.

I asked a similar question yesterday here: Flex executing a function on another view and I accepted the answer before I tried it. The problem is that the headermenu.mxml is not a child of appHome.mxml. They are both children of the main app.mxml. Secondly, the object that has the erase() is in a separate .as class I instantiate in appHome.mxml.

View 1 Replies

Actionscript 3 :: Flex View Component To Bind To Generic Object Using Reflection

Jun 24, 2011

Does there exist a Flex view component that you could just pass it a custom object with all public fields/properties that it could reflect over and produce a basic UI view using flex components. Is it possible to use something like the Spark DataGrid with one item laid out vertically. It would only have to support:

[Code].....

View 3 Replies

Flash :: Flex4 Host Component Have The Same Function As A View Mediator/helper?

Jul 17, 2011

Coming from Robotlegs/PureMVC, I am pretty familiar with the concept of the view mediator, i.e. a component that pretty much listens to events/requests coming from the "dummy" view and makes a further request, sends an application-wide signal/event, executes a command, etc, based on the request from the view. Can the host component idea introduced in Flex 4 be considered a the same as a mediator? The only thing that slightly bothers me is that host components are still considered views, because they extend SkinnableComponent or any of the classes that further inherit from it. In my view, the mediator should be completely left out of view logic.

Nevertheless, I do not want to write a skin, a host component, and a view mediator for that host component, because that would be quite an overhead, and would lead to more complexity rather than abstraction.Should I use host components as mediators, and put application-level logic there, for instance application level event dispatching?

View 1 Replies

ActionScript 3.0 :: Component For IPhone-like Spinner / Slot Machine List / Like Picker View?

Feb 5, 2010

Does anyone know of a component or tutorial for implementing a slot machine-like list similar to the interface component on the iPhone (example at URL...)? I did find one commercial component for flex at URL..., but am not sure how open this would be for modification (looks like it's a compiled SWC file in the example).

View 3 Replies

Flex - Equivalent Of "View Source" For <mx:HTML> Component?

Aug 4, 2010

After setting an control's location to some site. How could I then take a peek at the associated HTML? I notice that as soon as I set Location, htmlText becomes null and vice-versa... So how would one go about looking at the HTML displayed in the control in TEXT form?

View 2 Replies

Java :: View Part Of A Web Application - What Technology For A Pretty Intensive Grid View

Aug 3, 2010

I'm about to have to write a web page/app that will serve the agenda for circa 100 people on a page. One line per person, one column per day with 3 clickable zones in each cell. In HTML, the page is way complex for the browser to load quick and there is no possibility to click on a border between 2 cells to for example split an event that spreads among several cells. So I search an not too overkilling technology to render this kind of view. I begun with a PHP generated HTML page but the number of elements in the page make the mouse move jerky.

Moving to JAVA would give me better performances regarding the reuse of the generator of the view but it will still be an HTML page. So, here is my question: do you think that going forward with JAVA and its graphical capability is the simple solution or is Flash a better option for this part of a Web App? I'm afraid of the code I'll have to write in JAVA to handle the GUI presentation as well as the events generated by the 1000's cells plus borders of the page. In Flash, the graphical part seems simpler even if the actions handling is still huge.

View 2 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

Actionscript 3.0 :: Make A 360º View Bubble Like Google Street View

Mar 18, 2010

I am wondering how to make a 360º view bubble, like they use for Google Street View, but have no idea how to go at accomplishing this task... i have the string of photos that i attached in photoshop(so that if you connected the left to the right it would be a full 360º view).

View 1 Replies

As3 :: Process For Creating A Component?

May 15, 2007

OK, what's the process for creating a component in as3? Not AS2. If you ask anyone, they seem to refer you to as2 documentation. Also, I am strictly working with flash pro cs3 and have never used flex. I have lots of components from all the time with as2, but now need to convert everything over to as3. Or maybe, that's not possible and you have to still use both in some manner?

View 9 Replies

ActionScript 3.0 :: Creating A Custom Component?

Jun 3, 2009

I am creating a custom Component using ActionScript 3. This Component have some properties that can be changed in the Component Inspector, and in this component i create a text field to show a message that the user define in this panel.
 
So far, works ok. But i want to give a chance to the user choose a font type to this text field, i found in the Component Definition, a option called "Font Name", with this option, you can select a type of font to use.
 
The problem is to recover this font in my Class of the component. I try to use the Font Class, but it seems that this class was not created for this. My question is: What Class i have to use to recover the selected font from the Font Name option. I try this:
 
var newFont:Font = "Arial";
[Inspectable(name="Font name", type = Font, defaultValue = "Arial")]  public function set corPreloader(fonte:Font) {   newFont = fonte;  }  public function get corPreloader():uint {   return newFont;  }

View 3 Replies

ActionScript 3.0 :: Creating A Button Component?

Sep 22, 2010

I am creating a button component in AS3, the idea of this button is that you can set its parameters to the name of movie clips you want to use as its images (mouse up/over/down etc).So basically it's a button that you can easily change the appearance of, and this would be reflected in the preview on the stage. I made this component in AS2 and it worked very well and was very useful.
 
However there is a problem with this component in AS3 - When I create an instance of my button component and try to set images for it (remember these are the names of movie clips in the library which have been exported for actionscript), the preview of the button component does not show the images. When I compile the SWF the button component does show the images ok though.
 
When my button component redraws itself, it looks at it's parameters and calls getDefinitionByName to create an instance of the correct movieclip. I am guessing that the problem occurs because the movieclip I am trying to instantiate is not in the component's library, it is in the library of the project I am using the button in, so maybe the component doesnt know what that movieclip is?
 
But it's odd because when I compile/publish the SWF it works, like I said, it's just the preview of the component that doesnt work, and that's kind of the point, being able to get a preview of the button so it can be positioned and sized correctly.
 
I know I could get it to work by putting the movieclips I want to use for the button into the button component's library, but that again defeats the purpose of this component.

View 1 Replies

Flash :: Professional - Creating A Component In CS5

Oct 29, 2010

How can I create a component using Flash CS5? I have tried to follow various documents I have found on google and went about it in the following way:
 
1. I created an empty FLA.
2. I created a MovieClip containing some graphics, and named the MovieClip "MyTestComponent" in the Library.
3. I selected the MovieClip's properties in the Library and selected "Export for Actionscript", and made the MovieClip inherit from fl.core.UIComponent.
4. I saved the FLA in the directory "C:Program Files (x86)AdobeAdobe Flash CS5CommonConfigurationComponents" and restarted Flash. At this point I would expect that the MyTestComponent component would show up in the Components panel, but it did not.
5. I tried to publish the FLA as an SWC file and place the SWC file in the same file as above. According to my understanding, both this and the step above should have worked, but it did not.

View 4 Replies

Creating Tree Component In Flash With XML?

Apr 19, 2010

I have created a tree diagram using the 'Tree Component' in flash, and have linked it to my XML file:
<?xml version="1.0" encoding="iso-8859-1"?>
<node label = "Sports Club">
<node label = "Ball Games">
<node label = "Tennis" />
<node label = "Soccer"/>
<node label = "Bassball"/>
[Code] .....

If you haven't noticed yet, the tree diagram is nothing complicated, it branches out as 'ball games' and 'athletic games' with sub categories such as tennis, soccer etc. (or 100 Meter & Hurdles for Athletic sports.) Now I've managed to go this far, BUT, what i'm trying to do is that when the user chooses the subcategory e.g. 'Tennis' from the tree diagram, I need to get text into a blank text-box.

View 1 Replies







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