i am new to this topic so sorry if i am missing some basics.
i want to make a adobe premiere CC extension in Flash Builder 4.6 with Adobe Extension Builder 2.1, and i want to keep the application logic away from the design.
I have read Flex: How to keep code away from MXML and i know how Code Behind pattern works, but i don't know how to do this while creating a Extension.
i started a new Adobe Application Extension Project
project1Premiere.as
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>
and i found this error:
A file found in a source-path can not have more than one externally visible definition. txt;CSExtension project1Premiere.as /project1/src
am i missing some attribute in root of .mxml file to reference the .as ?
Thanks in advance,
Filip.