Skip to main content
Known Participant
August 21, 2013
Question

How do I access flash function using javascript?

  • August 21, 2013
  • 1 reply
  • 921 views

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);    }

This topic has been closed for replies.

1 reply

Inspiring
August 21, 2013

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.

https://www.adobe.com/go/wish/

FlyReyAuthor
Known Participant
August 21, 2013

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.