views:

69

answers:

3

i've loaded external swf into ScrollPane and i need to dispatch click event to this external swf. is it possible? ScrollPane.content.dispatchEvent(new MouseEvent(MouseEvent.CLICK,true)); doesn't work. this is obvious cuz ScrollPane.content is an DisplayObject and it have not CLICK event...

I can't use MovieClip as container for external swf cuz external swf is a documents converted to swfs using openoffice and it doesn't want to load inside MovieClip but perfectly loads inside ScrollPane and react on mouse clicks,but i need to simulate mouse click on it.

A: 

so you're saying that the following won't work or you haven't tried it?

var exSWF:MovieClip = MovieClip( ScrollPane.content );

or

var exSWF:Sprite = Sprite( ScrollPane.content );

Not sure to understand what you mean when you say that your external SWF won't load into a MovieClip.

Do you know what version of Actionscript was used for the external SWF, you can check that in debug mode by looking at the properties of the ScrollPane.content?

PatrickS
A: 

No, this doesn't work.It gives me error,something about "called method or property is null". i think it's because as i wrote already.... ScrollPane.content is DisplayObject and Casting it to MovieClip doesn't solve my problem.

And about loading into movieclip instead of scrollpane - it says something about can't position AS1/AS2...content... into AS3. i don't know much about how openoffice converts to swf and offcoz theres only one chance to find info - get sources and check them but i'm not so skilled in java, and theres a chance that jodconverter can add something to swf, i'm using jodconverter.jar to convert documents to swfs.decompiling of swf shows me only that openoffice converts every page to frame and adds to every frame stop(). thats all. Debug doesn't show info about external SWF

sorry for my english and i can't print errors cuz i'm from russia and flash IDE is on russian so i don't know how to correctly translate error messages to english.

khorght
A: 

got another info - the swf inside ScrollPane is not DisplayObject it's AVM1Movie, as i know this means the swf is AS1 or AS2 so i think when i try to .dispatchEvent(new MouseEvent(MouseEvent.MOUSE_DOWN, true, false)); it doesn't work cuz AS2 don't know this type of event, so another question - how to dispatch AS3 event to AS2 ? i've found AS2-AS3 Bridge but cant understand how to use it

khorght