How do I access flash function using javascript?
Copy link to clipboard
Copied
I try change list size in swf from js. It`s not work.
SWF
import flash.external.ExternalInterface;
ExternalInterface.addCallback( "methodResize", this, swfResize);
function swfResize(winX, winY) {
my_list.setSize(winX, winY); }
function init (){
this.createClassObject(mx.controls.List, "my_list", 1);
my_list.setSize(260,224);
....
JS
var win = (this instanceof Panel) ? this : new Window("palette", scriptName, undefined, {resizeable: true});
win.flashPlayer = win.add("flashplayer", [0, 0, 260, 224], flashFile);
win.onResizing = function () {
var winX = win.windowBounds[2];
var winY = win.windowBounds[3];
win.flashPlayer.preferredSize = [winX, winY];
win.flashPlayer.methodResize(winX, winY); }
Copy link to clipboard
Copied
just in case you are using AE CC, script communication with flash is broken in CC.
see this : http://forums.adobe.com/thread/1247861?tstart=30
Also please file a bug report for flash not working in estk under AE CC here - the more people filed those bug, the more chance they fixed it.
Copy link to clipboard
Copied
I use CS6. And then the other direction using communication JS and FLASH, from JS call Flash function.
I think that the error in my code. I have not found a working example for AE ESTK.
Sorry fom my googlenglish.

