- sprintf(buttonname, "::button%d", swf_GetDefineID(tag));
- //sprintf(functionname, ":clickLink%d", swf_GetDefineID(t));
- sprintf(functionname, "::clickLink1");
- abc_getlex(c,buttonname);
- abc_getlex(c,"flash.events::MouseEvent");
- abc_getproperty(c, "::CLICK");
- abc_getlex(c,functionname);
- abc_callpropvoid(c, "::addEventListener" ,2);
+ sprintf(framename, "[packageinternal]rfx::frame%d", frame);
+
+ if(!f && (tag->id == ST_DEFINEBUTTON || tag->id == ST_DEFINEBUTTON2 || stop_each_frame)) {
+ /* make the contructor add a frame script */
+ abc_findpropstrict(c,"[package]::addFrameScript");
+ abc_pushbyte(c,frame);
+ abc_getlex(c,framename);
+ abc_callpropvoid(c,"[package]::addFrameScript",2);
+
+ f = abc_class_method(cls, 0, framename, 0);
+ f->max_stack = 3;
+ f->local_count = 1;
+ f->init_scope_depth = 10;
+ f->max_scope_depth = 11;
+ abc_debugfile(f, "framescript.as");
+ abc_debugline(f, 1);
+ abc_getlocal_0(f);
+ abc_pushscope(f);
+ }
+
+ if(tag->id == ST_DEFINEBUTTON || tag->id == ST_DEFINEBUTTON2) {
+ U16 id = swf_GetDefineID(tag);
+ sprintf(buttonname, "::button%d", swf_GetDefineID(tag));
+ abc_getlex(f,buttonname);
+ abc_getlex(f,"flash.events::MouseEvent");
+ abc_getproperty(f, "::CLICK");
+ sprintf(functionname, "::clickLink1");
+ abc_getlex(f,functionname);
+ abc_callpropvoid(f, "::addEventListener" ,2);
+
+ if(stop_each_frame) {
+ abc_findpropstrict(f, "[package]::stop");
+ abc_callpropvoid(f, "[package]::stop", 0);
+ }
+ needs_framescript = 1;
+ }
+ if(tag->id == ST_SHOWFRAME) {
+ if(f) {
+ abc_returnvoid(f);
+ f = 0;
+ }
+ frame++;
+ }
+ tag = tag->next;
+ }
+ if(f) {
+ abc_returnvoid(f);