Actionscript 3 代码隐藏问题(Adobe Premiere CC扩展)
我不熟悉这个话题,所以如果我遗漏了一些基础知识,很抱歉 我想在Flash Builder 4.6和adobe extension Builder 2.1中制作一个adobe premiere CC扩展,我想让应用程序逻辑远离设计 我已经阅读并知道模式背后的代码是如何工作的,但我不知道在创建扩展时如何做到这一点 我启动了一个新的Adobe应用程序扩展项目 project1Premiere.asActionscript 3 代码隐藏问题(Adobe Premiere CC扩展),actionscript-3,apache-flex,adobe,code-behind,Actionscript 3,Apache Flex,Adobe,Code Behind,我不熟悉这个话题,所以如果我遗漏了一些基础知识,很抱歉 我想在Flash Builder 4.6和adobe extension Builder 2.1中制作一个adobe premiere CC扩展,我想让应用程序逻辑远离设计 我已经阅读并知道模式背后的代码是如何工作的,但我不知道在创建扩展时如何做到这一点 我启动了一个新的Adobe应用程序扩展项目 project1Premiere.as package { import com.adobe.csawlib.premiere.Premier
package
{
import com.adobe.csawlib.premiere.Premiere;
import com.adobe.csxs.types.Extension;
import com.adobe.premiere.*;
import spark.components.TextInput;
//re-declaring txt declared in project1.mxml
public var txt:spark.components.TextInput;
//Use CSExtension rather than WindowedApplication, as the base application
//class for extensions.
//This class previously was project1Premiere
public class CSExtension extends Extension
{
public static function run():void
{
var app:App = Premiere.app;
//your Premiere code here
txt.text = "testing...";
}
}
}
project1.mxml
<?xml version="1.0" encoding="utf-8"?>
<csxs:CSExtension xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:csxs="com.adobe.csxs.core.*" applicationComplete="appComplete()">
<fx:Script>
<![CDATA[
import com.adobe.csxs.core.CSInterface;
[Bindable]
private var hostName:String = HostObject.mainExtension;
public function appComplete():void{
CSInterface.instance.autoThemeColorChange = true;
}
]]>
</fx:Script>
<s:VGroup height="100%" width="100%" verticalAlign="middle" horizontalAlign="center">
<s:Button label="Run PR code" click="project1Premiere.run()" enabled="{hostName.indexOf('premiere') > -1}"/>
<s:TextInput id="txt"/>
</s:VGroup>
我发现了这个错误:
在源路径中找到的文件不能有多个外部可见的定义。txt;CSExtension project1Premiere.as/project1/src
在.mxml文件的根目录中是否缺少引用.as的某些属性
提前感谢,
菲利普。我完全无法回答这个问题,但我想试一试。 更改
public var txt:spark.components.TextInput代码>
到
public var txt:spark.components.TextInput=new spark.components.TextInput代码>
有什么变化吗?
我读了一些关于某些公共类的内容,这些类不需要用new
操作符实例化,但可以动态添加属性。如果TextInput不是这些类中的一个,则稍后在不创建实例的情况下将其设置为.text
属性可能会导致问题。我不完全明白,但这不是一个完全的暗中刺伤 我现在决定把我的逻辑放到project1.mxml文件中…我将在以后的阶段尝试分离逻辑和设计。。。无论如何谢谢你