I'm trying to learn how to make a flash element in a photoshop UI. I've managed to get one loaded and shown, but I can't seem to get extend script to send the swf file a function. my fla file is a simple box that I'm trying to move with a button in the UI. I made it so if you click on the box it moves, and that works, but I can't get it to move with the button in the extendscript UI. My fla code is: import flash.events.* import flash.display.* import flash.external.ExternalInterface myBox2.addEventListener(MouseEvent.CLICK,moveBox,false,0,true); function moveBox(event:MouseEvent){ myBox2.x += 5; } ExternalInterface.addCallback("moveBox3",moveBox3); function moveBox3(n){ myBox2.x += n; }; My Extendscript code is: #target photoshop var res = "dialog { \ fp: FlashPlayer { preferredSize: [550, 400] }, \ btn: Button {text: 'move box'}\ }"; var w = new Window (res,"Flash test"); w.margins = [0,0,0,0]; w.onShow = function () { var mySWFFile = app.path + '/Presets/Scripts/flashtest.swf' var movieToPlay = new File (mySWFFile); try { this.fp.loadMovie (movieToPlay); this.fp.playMovie (); } catch(e){alert(e)} } w.btn.onClick = function(){ w.fp.invokePlayerFunction("moveBox3,10"); } w.show() Any ideas on what I'm doing wrong?
... View more