--- In flexcoders@yahoogroups.com, "djepyon" <i...@...> wrote:
>
> Just make sure you register it before you make any LocalConnection
> calls. It could be on application init or if you have a bridge class
> housing the LocalConnection functionality register them in its
> constructor.
> 
> --- In flexcoders@yahoogroups.com, "thelordsince1984" <loreboa@> wrote:
> >
> > --- In flexcoders@yahoogroups.com, "djepyon" <ian@> wrote:
> > >
> > > Registering the VO with flash.net.registerClassAlias should be
all you
> > > need to do.
> > > 
> > > import flash.net.registerClassAlias
> > > import com.myproject.vo.myVO
> > > 
> > > registerClassAlias("com.myproject.vo.myVO",myVO);
> > > 
> > > --- In flexcoders@yahoogroups.com, "thelordsince1984" <loreboa@>
> wrote:
> > > >
> > > > hi everybody,
> > > > 
> > > > i've created a custom value object class..a simple class with
> private
> > > > properties and getters methods to retrieve them.
> > > > 
> > > > then i created an array collection where each item is a value
> object.
> > > > then i have a shared object manager that looks like this:
> > > > 
> > > > package util{
> > > > 
> > > > import flash.net.SharedObject;
> > > > 
> > > > import mx.collections.ArrayCollection;
> > > > 
> > > > public class SharedObjectApplicationManager {
> > > > 
> > > > private var mySO:SharedObject;
> > > > private var ac:ArrayCollection;
> > > > private var lsoType:String;
> > > > 
> > > > public function SharedObjectApplicationManager(s:String) {
> > > > init(s);
> > > > }
> > > > 
> > > > private function init(s:String):void {
> > > > mySO = SharedObject.getLocal(s);
> > > > if (getf()) {
> > > > getf();
> > > > }
> > > > }
> > > > 
> > > > public function getf():ArrayCollection {
> > > > return mySO.data.arrayc;
> > > > }
> > > > 
> > > > private function adda(array:ArrayCollection):void {
> > > > mySO.data.arrayc = new ArrayCollection();
> > > > mySO.data.arrayc = array;
> > > > mySO.flush();
> > > > }
> > > > }
> > > > }
> > > > 
> > > > so when i try to get arraycollection with getf method i get an
> > > > arraycollection of generic objects…not with value objects..in this
> > > > manner i can't get value properties of value object class.
> > > > 
> > > > so i would use registerClassAlias("Info", WindowInfo) where
> WindowInfo
> > > > is the VO..but where?
> > > > 
> > > > the architecture of my app is:
> > > > 
> > > > -main application (verify the shared object, if full then call a
> > > > public function of canvas to create windows with specific
parameters
> > > > saved in windowinfo class)
> > > > –canvas (contains one or more windows)
> > > > 
> > > > any suggestions?
> > > > 
> > > > thanks in advance
> > > > 
> > > > Regards Lorenzo
> > > >
> > >
> > ok but i can register the class in a particular point or in a specific
> > point of the application? for example in the main application..
> > 
> > thanks again...
> > 
> > Regards Lorenzo
> >
>
Thanks djepyon,

so i have to put the registerclass function in the constructor of this
class, is it true?

package util{

import flash.net.SharedObject;

import mx.collections.ArrayCollection;

public class SharedObjectApplicationManager {

private var mySO:SharedObject;
private var ac:ArrayCollection;
private var lsoType:String;

public function SharedObjectApplicationManager(s:String) {
init(s);

//here the register class alias????

}

private function init(s:String):void {

mySO = SharedObject.getLocal(s);
if (getf()) {
getf();
}
}

public function getf():ArrayCollection {
return mySO.data.arrayc;
}

private function adda(array:ArrayCollection):void {
mySO.data.arrayc = new ArrayCollection();
mySO.data.arrayc = array;
mySO.flush();
}
}
}

thanks again,

Regards Lorenzo

Reply via email to