How to cleanup when we logout

28 views
Skip to first unread message

sravan kumar

unread,
Dec 14, 2009, 1:20:26 AM12/14/09
to flex_...@googlegroups.com
Hi friends,
 
 
i would like to know how we can clean all the data in application and controls when we logged out.it means that it should go back to the login state agaign.please let me know is there any way to do this.

FreeMind

unread,
Dec 15, 2009, 7:32:13 AM12/15/09
to Flex India Community
Smply reload the same application URL again in the same window ...
this will surely save much time

sravan kumar

unread,
Dec 16, 2009, 9:42:13 AM12/16/09
to flex_...@googlegroups.com
i know that. but i dont want that application to be reload because my swf size is 4mb, if we reload it take time to load.
 
what i want  is, is there any way to identify all active objects and destroy when we log out from the application.

 
On 12/15/09, FreeMind <maniam...@gmail.com> wrote:
Smply reload the same application URL again in the same window ...
this will surely save much time

--

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



Jewel

unread,
Dec 17, 2009, 6:13:53 AM12/17/09
to Flex India Community
Hi Friend,

Are u developed your project in MVC framework?

If yes then use flowing code in your all helper.as file

package ba.core.helper
{
import ba.core.view.MainView;
import ba.event.UserNotify;
import ba.model.User;

import flash.display.DisplayObject;

import mx.core.Application;
import mx.core.Container;
import mx.core.IFactory;

public class MainHelper
{
public static const VIEW_FACTORY_NAME:String = "contentViewClass";

public static const CONTENT_VIEW_NAME:String = "contentView";

public var view:MainView;

public function get currectUser():User
{
return view.userInfo.data as User;
}

public function get contentView():Container
{
return view.getChildByName( CONTENT_VIEW_NAME ) as Container;
}

public function setupUserInfo(user:User):void
{
view.userInfo.data = user;
}

public function setupContentViews():void
{
var app:Application = Application.application as Application;
if ( !app.hasOwnProperty( VIEW_FACTORY_NAME ) )
{
return;
}

var contentFactory:IFactory = app[ VIEW_FACTORY_NAME ];
if ( contentFactory == null )
{
return;
}

var content:DisplayObject = contentFactory.newInstance() as
DisplayObject;
content.name = CONTENT_VIEW_NAME;
view.addChild( content );
}

public function notifyUserLogout():void
{
view.dispatchEvent(UserNotify.Logouted(currectUser));
}

public function removeContentView():void
{
if ( contentView )
{
view.removeChild( contentView );
}
}

public function updateTopicPath( value:Object ):void
{
view.topicPath.dataProvider = value;
}

public function updateContentViewState( value:Object ):void
{
contentView.currentState = value.state;
}
}
}

Thanks
Jewel

Reply all
Reply to author
Forward
0 new messages