I am getting a NULL object from the "CSXSInterface.instance" singleton. And this happens booth if I run the compiled SWF file in the debug standalone flash player and within Photoshop CS4 as a panel. Obviously the "CSXSInterface.instance" is important to communicate within Photoshop between JSX and AS3.
So I was hoping that you guys could clarify for me what I really need in order to develop SWF panels (just pure AS3, no flex). This is what I use at the moment:
- FlexSDK (3.5.0) & FlashDevelop (3.1.0 RTM) (my usual coding environment)
- Photoshop v11.0 (CS4)
- CSXSLibrary-2.0-sdk-3.4.swc (but same issue with CSXSLibrary-2.0-sdk-3.3.swc)
http://scriptplayground.com/tutorials/a ... Flash-CS4/ ... Flash-CS4/
http://www.adobe.com/devnet/photoshop/s ... l#csxsfile ... l#csxsfile
which is more or less including the SWC library and putting the compiled SWF in the \Plug-ins\Panels\ folder. But even with this simplified class and sample code I get a NULL object for the instance() singleton.
Code: Select allpackage
{
import com.adobe.csxs.types.*;
import com.adobe.csxs.events.*;
import com.adobe.csxs.core.CSXSInterface;
import flash.display.Sprite;
import flash.events.Event;
public class Main extends Sprite
{
public function Main():void
{
if (stage) init();
else addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(e:Event = null):void {
CSXSInterface.instance.addEventListener(StateChangeEvent.WINDOW_OPEN, creationComplete);
}
private function creationComplete(e:Event):void {
}
}
}
Would it succeed (according to some tutorials) it would call the creationComplete method. But even on triggered buttons so non loading and initialization triggered events I get a NULL object for the CSXSInterface.instance.
So...
If I need a older SWC library could someone send me one that works, or if there is something else to watch out please tell me. Also I explained the problem on the Adobe forums as well but they seem to be rather CS5 focused
http://forums.adobe.com/thread/710795
There might be some other bits to read from my question there. Hopefully I can start soon scripting for PS CS4 - as I have a lot of productive ideas that I want to develop.
thanks in advance,
Hendrik