|
From: Axel H. <ax...@3d...> - 2008-12-19 07:08:44
|
Jay Koutavas schrieb: > I use gnash. It tells me it's not finding the myFunc() function. The > init action is called before the function gets defined. Even if I > call addAction before addInitAction. gnash also reports failure if I > try to define myFunc() using an addInitAction. > > Every example in the ming tests, and on google searches shows just > straight actionscript being used to call existing Flash functions. Do > you have an example anywhere of how to create a function, and then > call it from an action? > > /Jay > > At 5:40 PM +0100 12/15/08, strk wrote: > > >> On Mon, Dec 15, 2008 at 11:37:46AM -0500, Jay Koutavas wrote: >> >>> Thanks, got past that now. Next question: >>> >>> Why doesn't it work? >>> >>> -- there's no trace output of "myFunc was called" in the output pane >>> on CS4 Flash, though I can get output if I call trace() directly in >>> my init function. >>> >> Try using Gnash, it'll tell you more if you enable ActionScript >> errors verbosity. >> http://www.gnu.org/software/gnash >> >> --strk; >> > > > Hi, here is how I debug my ming actionscript: <?php ming_useswfversion(8); $w = 640; $h = 480; $movie = new SWFMovie(); $movie->setDimension($w, $h); $movie->setBackground(0xcc, 0xcc, 0xee); $layer = new SWFSprite(); $s = new SWFShape(); $font = new SWFFont("../mingres/Arial.fdb"); $t = new SWFTextField(); $t->setFont($font); $t->addUTF8String("naughty@home"); $t->setColor(80, 0,0); $t->setHeight(40); $t->setName('label'); $handle = $movie->add($t); $handle->setName('textfield'); $handle->moveTo(150, 120); $action = <<<EAC dumpObject(textfield); debug(label); function debug(m){ _root.getURL('javascript:debug(\"'+m+'\")'); } function dumpObject(o){ debug('dumpObject:' + o); if(typeof(o)=='movieclip'){ debug(o._name+":"); pl = props.length; for(p=0;p<pl;p++){ debug(o._name+'.'+props[p]+' = '+o[props[p]]); } } for(e in o){ debug(typeof(o[e])+"->"+e+':'+o[e]); } } EAC; $movie->add( new SWFAction($action) ); $movie->nextFrame(); $movie->add( new SWFAction("debug('Stop Movie now!');stop();" )); $movie->nextFrame(); header('Content-type: application/x-shockwave-flash'); $movie->output(0); ?> you can see how it works with firefox opened with -console on http://teamtrier.de/mingdevel/netScreen.php?movie=text.php Axel |