import mx.core.FlexGlobals;
import mx.core.Application;
[color=green]FlexGlobals.topLevelApplication.任意组件ID.text="theText";(Flex4写法)
Application.application.任意组件ID.text = "theText";(Flex3写法)[/color]
import mx.core.Application;
[color=green]FlexGlobals.topLevelApplication.任意组件ID.text="theText";(Flex4写法)
Application.application.任意组件ID.text = "theText";(Flex3写法)[/color]
package com.user.command
{
import com.adobe.cairngorm.commands.ICommand;
import com.adobe.cairngorm.control.CairngormEvent;
import com.user.event.UserEvent;
import com.user.service.UserProxy;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.core.Application;
import mx.core.FlexGlobals;
import mx.rpc.IResponder;
public class UserCommand implements ICommand, IResponder
{
public function UserCommand()
{
}
//执行调用
public function execute(event:CairngormEvent):void
{
var userEvent:UserEvent=UserEvent(event);
var userService:UserProxy=new UserProxy(this);
userService.login(userEvent.username,userEvent.password);
}
//更新模型
public function result(data:Object):void
{
var message:String=data.result as String;
// Application.application.mainContainer.removeElement(Application.application.loginPanel);
//
// Application.application.main_.message_label.text=message;
FlexGlobals.topLevelApplication.mainContainer.removeElement(Application.application.loginPanel);
FlexGlobals.topLevelApplication.main_.message_label.text=message;
}
public function fault(info:Object):void
{
Alert.show("Fail Error ");
}
}
}