Flex :: Architect Extended Cairngorm Classes To Be Shared Across Applications?

Jun 5, 2009

I have created a few Event and Command classes for use in my Cairngorm projects.For example, I created an class that extends URL... that allows me to set callback functions upon completion or failure of the corresponding Command. To accomplish this, I also had to create a new Class that implements com.adobe.cairngorm.commands.ICommand that I extend for all Commands in my projects.Now, I want to use these two classes across all of my Cairngorm applications. What is the best way to do this? Should I just edit the Cairngorm source for CairngormEvent and ICommandand recompile the Cairngorm MVC (is that even possible)? Or add my two classes to the Cairngorm source and recompile the Cairngorm MVC? Or should I just add them to a shared library?I've chose the third option for now, but this requires that I reference the Cairngorm library in both my library and each project. I am wondering if there is a better practice and what the benefits are.

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Unexpected Errors, Multiple Helper Classes, Extended Classes?

Jan 9, 2010

The examples I'll use don't do anything - they're classes without ANY members - no variables, methods, anything.

Let's say I extends Sprite and call it MySprite.

I save it in test.core

[code]...

Now I create another custom class called MyWindow that extends MySprite.

I save it in test.windows

[code]...

Then I create another class that extends MyWindows (the example I'll use is a document class - but that doesn't matter - I've tested using an instance too).

[code]...

Notice that I'm not even trying to instantiate the helper classes - just having them there throws the error.

If there is only a single helper class, everything runs fine.

Also note that - as far as I can tell - this only happens when extending one class from another package, then extending that class with more than one helper object.I'm pretty sure there's no namespace bumps or typographical errors, as this is a very pared-down version of the original application.

EDIT: seems the problem exists even without the crossing packages - even extending MySprite in the document class with multiple internal classes generates this error.

View 4 Replies

Flex :: Storing Instances Of Classes In Shared Objects

May 26, 2010

Is it possible to store instances of a class in a cookie or in shared objects.

Basically in my application I have an object "Diagram" that the user can create. If they hit save, I want to store the current instance as a cookie and allows them to reload it later.

Alternatively, I could see about getting them to store the saved version on the hard disk. But even then, all I want to save and retreive is my actionscript object.

I've tried storing the object to SharedObject.data.diag, but when I try to retrieve the object from the cookie doing SharedObject.data.diag as Diag returns null.

View 1 Replies

ActionScript 3.0 :: Can't Use Extended Classes Variables Or Methods

Dec 1, 2010

I have this problem from time to time with AS3 where I extend a Class and then try call methods and variables which are public from the new class but I get errors that method or variable doesn't exist. My IDE recognises the methods and variables though.[code]When I run the script flash hates it. I thought when you extend a class it was supposed to inherit its properties and methods?Does anyone else have these problems? I shouldn't have to cast it as Box. I swear I have this working in a project but cant see the different in setup?

View 4 Replies

Actionscript 3 :: Memory Management When Instantiating Extended Classes?

May 16, 2010

I'm developing an AS3 application which has some memory leaks I can't find, so I'd like to ask some newbie questions about memory management.Imagine I have a class named BaseClass, and some classes that extend this one, such as ClassA, ClassB, etc.I declare a variable:

myBaseClass:BaseClass = new ClassA();

After a while, I use it to instantiate a new object:

myBaseClass = new ClassB(); some time after

myBaseClass = new ClassC();

and the same thing keeps happening every x millis, triggered by a timer.Is there any memory problem here? Are the unused instances correctly deleted by the garbage collector?

View 2 Replies

Actionscript 3 :: Extended Classes Doesn't Understand Updates?

Dec 2, 2011

I use Flash Professional CS5.5 with Gaia FrameWork in my project. movieclips in the project have extended classes and the problem is that when I give new functionality to my classes they doesn't work in an build project. for example function s cann't be found, trace doesn't work and so on. All the old functionality works. When I change class name then it works fine. but then it happens again. I made new project and coped all the content, but still it happens. I event rainstalled flash but nothing works.

View 1 Replies

ActionScript 3.0 :: Can't Access Properties Of Extended Abstract Classes

Dec 10, 2009

Im building a project using an MVC pattern. I have (pseudo) abstract classes Model and View, each extended with particular models and views. But I cannot access properties on the extended classes of Model...Model simply distributes XML data, heres its constructor:

Code:
public function Model(data:XML)
{
_data = data; /*_data is a protected var of type XML in Model*/
}

MainModel extends Model, and has a property called _background of type Background which also extends Model:

Code:

private var _background:Background = new Background(some XML source);
public function MainModel(data:XML)
{

[code]....

The problem arises when I try to pass MainModel's background property as a parameter of _bgView (highlighted in red above). The compiler says there is no background property on Model, which is true, but I need it to look at its extended class MainModel, not Model. I've typed MainView's constructor parameter with MainModel, but it is still seeing it as Model.

View 8 Replies

ActionScript 3.0 :: Can't Access Properties Of Extended Abstract Classes?

Dec 10, 2009

Im building a project using an MVC pattern. I have (pseudo) abstract classes Model and View, each extended with particular models and views. But I cannot access properties on the extended classes of Model...Model simply distributes XML data, heres its constructor:

Code:
public function Model(data:XML)
{

[code]......

View 3 Replies

ActionScript 3.0 :: Multiple Internal Classes With An Extended Public Class?

Jan 9, 2010

If I have a class that extends another, e.g.,
 
package {
import flash.display.Sprite;
public class MySprite extends Sprite{

[Code]....

and extend that class, if more than one internal classes are defined:
 
package {    
public class MainClass extends MySprite {         
public function MainClass():void{}   

[Code]....

ReferenceError: Error #1065: Variable MainClass is not defined.Note that this only happens (as far as I can tell) when the public class of the package extends another class, and multiple internal classes are defined. The internal classes don't even need to be instanced or referenced to generate the error (the bare-bones code above will error out). If only a single internal class is defined, it works fine (no error).  Even if the internal class is instanced.

View 11 Replies

ActionScript 2.0 :: Static Classes Shared Across Multiple SWF's?

Apr 11, 2009

How do Static classes work in projects where child swf's use the same Static class as their parent?

For simplicity... lets say we have some older content swf files that are using TweenLite version 8 ( a common enough Static class.) But the parent SWF is being updated and uses a more recent version of TweenLite (version 10). The child SWF's are loaded into the parent SWF. Do the child SWF exist in there own sandbox and have TweenLite version 8 running and the Parent runs it's own copy of TweenLite 10? Or does the parents clips Static class of TweenLite (version 10) overwrite the children Static class using some sort of magical shared memory space when JIT (runtime) compiling?

View 3 Replies

ActionScript 3.0 :: Runtime Shared Library Store Classes?

Sep 19, 2009

working a project that has 9 swf.a lot of the swf are using the same classes like papervison and tweenlite.is there a way to store classes like papervison in a share library?

View 1 Replies

Flex :: Hidden Features Of Cairngorm?

Jul 22, 2010

I found a lot of interesting info in the 'hidden features of...' series. I am very new to cairngorm . What are some of the hidden features of cairngorm.

View 1 Replies

Flex :: Use Of CairngormEvent In Cairngorm Framework?

Jul 28, 2010

What is the use to event extend the cairngorm event in cairngorm framework.?

View 1 Replies

Flex :: Add SWC File For Cairngorm To App Without FlexBuilder?

Aug 12, 2010

I am not using FlexBuilder, I'm using the free Flex SDK with TextMate. I'm having some trouble figuring out what this FlexBuilder process actually does behind all the nice dialogs and things, so that I can do the same thing by tweaking whatever the relevant file is, but Googling just points me at similar instructions telling me to use FlexBuilder.

View 1 Replies

Professional :: Loading External Swfs Extending From Classes In The Same Shared Codebase?

Jul 25, 2011

I'm currently developing a game in flash and want to be able to divide up my .fla assets in a way that means artists can work on a game menu .fla in isolation from the game.fla and rest of the game code.If I could briefly explain how I've approached this so far, I would be extremelyMy project is setup like this:HighScoreMenu.fla -> document class HighScoreMenu extending GameMenu class.game.fla ->document class game.asgame.as class loads the published HighScoreMenu.swf and manipulates the menu i.e. animates on and off screen via inherited functions in the GameMenu class.

Now this seemed to work to begin with, until my code evolved and upon going to publish my HighScoreMenu.fla flash started complaining about symbols being used in Game.as that were in Game.fla... If I'm only publishing the HighScoreMenu which extends from GameMenu then why is it even looking to compile Game.as

View 4 Replies

Actionscript 3 :: Storing Array Of Custom Classes In A Locally Shared Object (LSO)

Sep 22, 2011

I am having problems storing an array of objects, all of which are the same custom class in an LSO and then reloading that array from the LSO without losing the class type of the objects in the list.

I know how to store a single object of a custom class and load it withe the correct class type using the registerClassAlias() function, but I cannot seem to apply this to arrays of objects.

I am trying to save an array called messageList. Each element is a custom class GameMessage with a property called gameLevel. After I load the LSO I am trying to do something like

trace("0th message is from level " + GameMessage(messageList[0]).gameLevel);

And I am getting an exception of like this:

TypeError: Error #1034: Type Coercion failed: cannot convert Object@90fdfa1 to GameMessage.

I have registered the GameMessage class using

registerClassAlias("GameMessage", GameMessage);

and everything works if rather than a list of messages I try and save/load a single message.

View 1 Replies

Flex - Cairngorm XXXCommand Be Executed Several Times?

Oct 8, 2009

I ran into a problem.I'm doing a GIS program using flex. There's a map in my Application,when I click one icon on the map,windowA pops up,when I click a link inside windowA,windowB pops up,but here my problem coming out,when I close windowB and click the link inside windowA another time,Two windowB pop up...

[Code]...

View 3 Replies

Actionscript 3 :: Flex - Use Framework Like Cairngorm Or Mate?

Feb 13, 2010

From what I understand a framework reduces complexity in areas that are common, like a log-in system. I use ASP.NET MVC at work and have done some work in Zend Framework but do not get how a framework helps with client side development. The reason ASP.NET MVC is used at work is for Unit Testing - does a Flex framework help with this too? why I should or should not use a framework with Flex?

View 4 Replies

Flex :: Project Doing In Mvc Pattern Using Cairngorm Framework?

Jun 17, 2010

I wish to do my project in mvc pattern. so I chose cairngorm framework and just read some of the document about this framework.But I cant understand deeply to do project using this framework. Have any methods or examples to study doing project in cairngorm framework??

View 1 Replies

Flex :: Cairngorm - Use Parsley Framework Hero 4.5?

Nov 30, 2010

I was wondering if Parsley framework is compatible for Flex Hero Mobile 4.5? I seem to get a warning saying it's not compatible.

View 2 Replies

Flex - Cairngorm Model Locator Pattern?

Jul 5, 2011

In Cairngorm (Flex Framework), there is Model Locator Pattern, which is similar to Global variables, is it a right pattern, Adobe is saying for flex its best pattern

[Code]...

View 1 Replies

Flex :: Cairngorm 3 Presentation Model Initializations?

Jul 13, 2011

I have a TitleWindow that I open up... and I have 6 states defined.I am using the Presentation model pattern for all of my views. When I tell my window to go to XXX state, the controls have to initialize since the states in flex use lazy loading. so... my PM code that says myTextArea.text bombs out and say "cannot access..." so as a work around, I made some creationComplete events on my controls to register the control with the PM. So when the state changes, the textarea finally initializes and on creationComplete calls PM.registerTextArea() which sets a reference to it. then in that function I run my code... myTextArea.text.. etc.

This seems like such a ugly hack that I hate it. Is there any way to wait until the entire state in created then call code on the PM? I have tried enterstate... but this event seems to fire before the state controls are ready.I tried to add a comment, but I guess editing is the only way I can do this...I am doing something slightly off straight PM. Every view has a viewController (as I call them). Its kinda my own hybrid of a delegate / dataprovider. But this is moot. It's the flex component lifecycle when dealing with states that is the pain.if you change state.. there is no event to say "all my components in this state are ready".only event to say "we changed state". so my code that fires on state change is trying to talk to components that aren't ready yet.So from what I see, there seems to be no design pattern or perfect way to ensure that all components are created in a state unless using creationComplete on every component in the state to register it is ready... if you don't, you get a race condition. Regardless of frameworks or design patterns, this seems to be a root issue.

I am trying to attach video to a display once I get to that state. This is done via addchild. regardless of where I do it.. I need to know that the videoDisplay is done loading before I call addchild. I even tried currentStateChange event since docs say that fires last... but alas.. the components in the state are still initializing. So it seems that creationComplete is my only option. Maybe the only sane way to keep to clean code is to create the entire thing(videodisplay and video) using as once the state is entered. I just hoped the flex framework had events to ehlp me here rather than buiilding everything on the fly in as.

View 1 Replies

Flex :: Reading Server URL From AS3 For Cairngorm Configuration

Aug 30, 2011

I need to read the URL that the browser shows when a Flex application is called because I would to reference it in a mxml configuring Cairngorm remote objects. The goal I would reach is to automatically configure Cairngorm services from environment to environment (dev,test,qa,prod) without statically set the value in the mxml or other ActionScript. Since the Flex client is deployed in the root of the war of the webapp, it's enough to read where the browser is pointing.

I have written a class that is doing so:
public class ConfigServer {
public function ConfigServer() {
var loaderUrl:String = FlexGlobals.topLevelApplication.loaderInfo.loaderURL;
var urlToSet:String = <loaderURL-string-manipulation>;
_serverUrl = urlToSet;
[Code] .....

But whenever I call the ConfigServer constructor and for every (known to me) technique I applied (statics or singletons or public ro so on), I have always had the same error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at org.fao.fapda.util::ConfigServer()[C:devworkspacesFAPDA runkFAPDA-clientsrcorgfaofapdautilConfigServer.as:8]

Cairngorm services initialization is done as follow:
<fx:Declarations><cut/>
<services:FAPDAServices id="services"/>
<cut/></fx:Declarations>
And the problem is that FAPDAServices.mxml is read runs before FlexGlobals is valid. Is there a point in the Flex Application lifecycle where such loaderURL is defined so that I can construct ConfigServer? When in startup events that initialization in done?

View 1 Replies

Flex :: UIComponent Extended Class Isn't Showing UIComponent Extended Class

Aug 18, 2009

I have 1 class (that is extending a UIcomponent) that is representing a component. In that component I create different instances of another class that is also a UIComponent but this class doesn't show up in de first class. I see that it is running and that it has the correct hights but I got the feeling that it doesn't show up with this hights. If I trace I see the width and height is 200 X 200 but there is still nothing visible in my component.

View 1 Replies

Flex :: Coding Style - Cairngorm Project DRY (don't Repeat Yourself)?

Aug 2, 2009

I'm having a hard time building a Cairngorm Flex3 app that connects to a rails app. I'm used to rails DRY approad, and the Convention over Configuration thing too.. and Cairngorm in awful at these.

How do you keep you flex code as DRY as possible? I've implemented a generic delegate to avoid a delegate for each command, at least.

View 1 Replies

Flex :: Make Cairngorm Commands ALWAYS Work Synchronously

Oct 1, 2009

I see the benefit of asynchronous commands (waiting for server responses...) but in my flex app it creates me more problem than anything. Here's what I want: EVERY command executes only after the previous one returned (to result or fault function) And I'd like to do this as easily as possible.. by the way the GUI must become irresponsive (maybe a wait message) while a long command is being executed (I could show the wait message in the execute function and remove it in the fault or result function..)

View 1 Replies

Flex :: Difficult Syncronization Problem With Commands (in Cairngorm)?

Jan 8, 2010

I have a dataGrid with a dataProvider "documents"A column of the datagrid has a labelFunction that gets the project_id field of the document, and returns the project name, from a bindable variable "projects"Now, I dispatch the events to download from the server the documents and the projects, but If the documents get downloaded before the projects, then the label function gives an error (no "projects" variable)Therefore, I must serialize the commands being executed: the getDocuments command must execute only after the getProjects command.In the real world, though, I have dozens of resources being downloaded, and those command are not always grouped together (so I can't for example execute the second command from the onSuccess() method of the first, because not always they must be executed together..)..

View 1 Replies

Flex :: Compile Project That Uses Cairngorm With Command Line?

Oct 31, 2010

Has anyone tried to compile a flex project that uses Cairngorm with command line?

View 1 Replies

Actionscript 3 :: Not Assigning Data From Java VO To Flex VO Using Cairngorm?

Jan 23, 2012

I have a few values in Java VO, and using cairgorm framework, i had mapping the Java VO to Action script VO in Flex and given same variables name as java Vo variables name. Now the Vo is mapping fine and when looking the result all variables are displaying as null. Can i know the reason for that.Java returning list of VO's.

package com.configuration
{
import com.adobe.cairngorm.vo.IValueObject;

[code]......

View 1 Replies

AS3 :: Android - Architect A Tablet App That Only Needs To Connect To A Laptop To Update Content?

Mar 29, 2012

I've built apps that connect to a server. But this time a client has asked for an app with no need to connect to a server to update content (images,videos,text). It will be Android tablet to a Windows laptop via USB. It will be for end user no dragging and dropping into specific folders using USB debugging. I was thinking I may need to build an app for the laptop (content manager) and then the app for tablet. Is a framework out there that could jump start this?

View 2 Replies







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