The application and the module are different objects, you can't access the
variables of one object from the other one without referencing the first one
some how!

It's better to use the ResourceManager to handle the different languages.
When you get the strings from the db, just set them in the resource manager
and in the different parts of the application, get the values with the
get-methods of resourceManager.

Another point: if you are going to instantiate the modules with "new" or
insert them with mxml, it's better to make them to components (subcalss from
a container i.e. Canvas instead of Module). Modules are bigger and are
designed to be loaded dynamically at runtime.

Hope this helps!


On Thu, Oct 9, 2008 at 11:49 AM, Deniz Davutoglu <
[EMAIL PROTECTED]> wrote:

>   Hi,As I yesterday mentioned we started some app to write in
> flex+amfphp one thing that we need to do is to seperate appliacation
> in modules. As this application needs to be multilingual I got all
> content from database in one ArrayCollection and Bind every part with
> rigth object. but here some problems starts. I can't reach variables
> of main application whitin module. Does it any way to reach them in
> flash way (parent or root) properties with binding.
>
> here you can see sample codes
>
> main application code
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application
> xmlns:mx="http://www.adobe.com/2006/mxml";
> xmlns:local="*"
> layout="absolute"
> width="500" height="510" applicationComplete="ing()">
>
> <mx:Script>
> <![CDATA[
> import modules.login;
> public var basliktxt:String="deneme baslýðý"
> public function ing(){
> var Login:login= new login()
> this.addChild(Login)
> }
> ]]>
> </mx:Script>
>
> </mx:Application>
>
> Module code
>
> <?xml version="1.0" encoding="utf-8"?>
>
> <mx:Module xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute"
> width="250" height="150" cornerRadius="5" backgroundColor="#FFFFFF">
> <mx:Label x="10" y="9" text="{basliktxt}" id="baslik"/>
> <mx:Label x="10" y="48" text="Label"/>
> <mx:Label x="10" y="74" text="Label"/>
> <mx:TextInput x="53" y="72"/>
> <mx:TextInput x="53" y="46"/>
> <mx:Button x="148" y="102" label="Button" click=""/>
> </mx:Module>
>
>  
>



-- 
Haykel Ben Jemia

Allmas
Web & RIA Development
http://www.allmas-tn.com

Reply via email to