I consider Application.application.variableName a bad practice, as it
introduces tight coupling with the main application, global variables
declared in the main application and accessed by child components is a no
go.

Singletons could be one way, this post might help -
http://www.switchonthecode.com/tutorials/flex-actionscript-singleton-model-class

Remember, there are no hard and fast rules to enforce/tell the compiler to
do garbage collection, flex compiles does it with his own prerogative, but
make sure you have your variables dereferenced, also singletons are not
garbage collected, another very informative post of singletons here -
http://www.badu.ro/?p=62


-Saurabh
http://blog.saurabhnarula.com/

On Fri, Nov 26, 2010 at 2:14 PM, Jitendra Jain <
[email protected]> wrote:

> Hi
>
> Singleton Pattern -- This means there is only one object of the class that
> is flowing around the application. Whatever is a shared resource you can put
> that into this object. And other classes will look for the shared resources
> into this object.
>
> Garbage collection : You have to assign null and also remove the event
> listeners if accossiated to make it eligible for garbage collection.
>
> Framework :The idea behind using a framework is only that the code is in
> proper structure. Without framework you can work...
>
> Let me know if you want to know more or have any queries.
>
> Regards,
> Jitendra Jain
>
>
> On Fri, Nov 26, 2010 at 12:20 PM, HISSAM <[email protected]> wrote:
>
>> If your variable is any object apart from int,boolean,string .. . make
>> sure u remove any event listeners addded to that object and make it to
>> null. but do this only when u r assured no other objects will be using
>> it.  Also, remove all the refrences to the object if u have added in
>> other classes.
>>
>> Go thru the link for GC
>>
>> http://active.tutsplus.com/tutorials/workflow/quick-tip-understanding-garbage-collection-in-as3/
>>
>>
>> On Nov 26, 9:34 am, Pavan B <[email protected]> wrote:
>> > Thanks! will that be a garbage collection issue, we don't have any
>> framework
>> > implemented right now and i am worried about the garbage collection
>> issue.
>> >
>> > On Thu, Nov 25, 2010 at 11:11 PM, mahek joshipura <
>> [email protected]>wrote:
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > > Hello Pavan,
>> >
>> > > You can use the singleton class and define a variable in it to access
>> the
>> > > variable from any location.
>> >
>> > > Regards,
>> > > Mahek
>> >
>> > > On Fri, Nov 26, 2010 at 6:25 AM, Pavan B <[email protected]>
>> wrote:
>> >
>> > >> Is there any option to a value in a variable (which is declared
>> globally
>> > >> for entire project or in the main (default) mxml file) and access it
>> from
>> > >> anywhere in other components in the same project.
>> >
>> > >> --
>> > >> Thanks
>> > >> Pavan
>> > >> 814-431-0669
>> >
>> > >> --
>> > >> You received this message because you are subscribed to the Google
>> Groups
>> > >> "Flex India Community" group.
>> > >> To post to this group, send email to [email protected].
>> > >> To unsubscribe from this group, send email to
>> > >> [email protected]<flex_india%[email protected]>
>> <flex_india%2bunsubscr...@googlegrou ps.com>
>> > >> .
>> > >> For more options, visit this group at
>> > >>http://groups.google.com/group/flex_india?hl=en.
>> >
>> > >  --
>> > > You received this message because you are subscribed to the Google
>> Groups
>> > > "Flex India Community" group.
>> > > To post to this group, send email to [email protected].
>> > > To unsubscribe from this group, send email to
>> > > [email protected]<flex_india%[email protected]>
>> <flex_india%2bunsubscr...@googlegrou ps.com>
>> > > .
>> > > For more options, visit this group at
>> > >http://groups.google.com/group/flex_india?hl=en.
>> >
>> > --
>> > Thanks
>> > Pavan
>> > 814-431-0669
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Flex India Community" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<flex_india%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/flex_india?hl=en.
>>
>>
>
>
> --
> Thanks and Regards,
> JJain,
>
>    If you have knowledge, let others light their candles in it --Margaret
> Fuller:
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Flex India Community" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<flex_india%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/flex_india?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en.

Reply via email to