angus.wood Posted May 3, 2014 Share Posted May 3, 2014 Calling Action Script 3.0 (the current version) functions from Unigine script does not appear to work. Older versions work. flash = new WidgetFlash(engine.getGui(),swfpath); if (flash == NULL) { log.message("Failed to load [%s]\n",swfpath); return NULL; } log.message("Loaded SWF [%s]\n",swfpath); engine.gui.addChild(flash,GUI_ALIGN_OVERLAP | GUI_ALIGN_BACKGROUND); flash.play(); flash.runFunction("test_function"); log.message("Height = [%d]\n",flash.getFlashHeight()); The issue seems to me to be focussed around the new code layout in Flash CC / AS3.0. The new way is to have a "package {}" wrapper around an AS class, for example the AS code that I'm trying to call is below; package two { import flash.display.MovieClip; public class two extends MovieClip { public function two() { // constructor code trace("constructor"); } public function test_function() { trace("test_function called"); //Engine.logError("Test!"); } } } The error message given is FlashContext::runFunction(): can't find "test_function" function I have also tried calling it as; test_function() two.test_function two.test_function() It is important to get this version of Flash / Actionscript working as Adobe do not sell or support the older versions any more. Link to comment
steve3d Posted May 4, 2014 Share Posted May 4, 2014 read this https://developer.unigine.com/en/docs/1.0/code/actionscript Unigine engine supports ActionScript 2.0 to control the flash movies in the Unigine-based applications.All UnigineScript methods can be called from ActionScript code via Engine extension class. So, unigine don't support AS 3 for now. Link to comment
Recommended Posts