Flash IDE 项目 ActionScript 3 到 Flex:如何转换?
您好,我有一个使用 Flash CS3 IDE 和 ActionScript 3 构建的项目。现在我需要将一些功能与文件引用类集成。这仅在 Flex 中可用。所以我想迁移到flex(MXML)..
这怎么可能?
我做了一些代码,但无法正常工作
ProjectFile.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete = "initApp()" >
<mx:Script>
<![CDATA[
import mx.core.UIComponent;
public function initApp():void {
var app:Applications = new Applications(this);
addChild(app);
}
]]>
</mx:Script>
</mx:Application>
应用程序.as 之前从 FLA 调用了应用程序类,现在我需要将我的基类添加到 mxml。
package {
import com.AnotherClass;
import flash.display.*;
import flash.events.*;
public class Main extends Sprite {
public var _mystage:Stage;
public function Main() {
var app:AnotherClass= new AnotherClass(this);
addChild(app);
}
}
}
但我无法在 MXML 上加载 Applicatios 类对象。
Hi I have a project which is build with Flash CS3 IDE and ActionScript 3. Now I need to integrate some feature with file refrence class. that is avail only in flex. So I want to migrate to flex(MXML)..
how is it possible?
I did some code, but doesn't work properly
ProjectFile.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete = "initApp()" >
<mx:Script>
<![CDATA[
import mx.core.UIComponent;
public function initApp():void {
var app:Applications = new Applications(this);
addChild(app);
}
]]>
</mx:Script>
</mx:Application>
Applications.as
The Applications class is called from the FLA earlier, now i need to add my base class to mxml.
package {
import com.AnotherClass;
import flash.display.*;
import flash.events.*;
public class Main extends Sprite {
public var _mystage:Stage;
public function Main() {
var app:AnotherClass= new AnotherClass(this);
addChild(app);
}
}
}
But Iam unable to load the Applicatios class object on the MXML.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当然,您可以使用
FileReference.save
,而无需部署 AIR 内容和/或移植到 Flex。唯一的问题是:FileReference.save
在 Flash Player 10 或更高版本中可用,但 CS3 只能部署到 Flash Player 9。事实证明您仍然可以做到这一点,但有点混乱,你必须使用一点技巧:
图书馆。它们是 Flex SDK 的一部分,您可以从 Adobe 免费。
FileReference.save
程序。
一切都应该有效。
(这些提示大部分来自 ZEROSEVEN 的德语页面)。
Of course you can use
FileReference.save
without deploying AIR content and/or porting to Flex. The only problem is:FileReference.save
is available in Flash Player 10 or greater, but CS3 will deploy only up to Flash Player 9.It turns out you can still do it, but it's a bit messy, and you have to use a little hack:
libraries. They are a part of Flex SDK, which you can download from Adobe for free.
FileReference.save
in yourprogram.
everything should work.
(Most of these hints are from ZEROSEVEN's german page).