All my buttons stopped working, and i have no error in codes or anything :s
so working in ios app using adobe flash pro cs6 , had btn starting on frame on, in background layer, btns never dissappear layer contains code 3 buttons (back, menu, next) as3 layer , background n buttons layer have key frame in frame 2 until frame 100 no other keyframes.. decided add menu right in first frame (1) 3 more buttons (actually working 3) , notice when delete codes in frame 1 (menu buttons) other 3 buttons start working, if code again 3 buttons frame 2 stop working, here codes:
the 3 buttons of menu (the working one, when delete code others start working)
/*import flash.events.mouseevent;
stop();
chapt_sel.addeventlistener(mouseevent.click, chapterselect);
inst_btn.addeventlistener(mouseevent.click, instructions);
abt_btn.addeventlistener(mouseevent.click, aboutme);
function chapterselect(evt:mouseevent) :void {
gotoandstop(5);
}
function instructions (e:mouseevent) :void {
gotoandstop(2);
}
function aboutme(a:mouseevent) :void {
gotoandstop(15);
}*/
as see has /* */ close code other buttons work
and here's code non-working one, unless close code above:
import flash.events.mouseevent;
stop();
// eventlisteners n others
menu_btn.addeventlistener(mouseevent.click, menufunc);
next_btn.addeventlistener(mouseevent.click, nextfunc);
back_btn.addeventlistener(mouseevent.click, backfunc);
// variables
// functions
function backfunc(evt:mouseevent):void
{
var invalidframenumbers:array = new array(1, 5, 11, 13);
var validpress:boolean = true;
(var i:int = 0; < invalidframenumbers.length; i++)
{
if (invalidframenumbers[i] == this.currentframe)
{
validpress = false;
break;
}
}
if (validpress)
{
prevframe();
}
}
function nextfunc(e:mouseevent):void
{
var invalidframes:array = new array(5, 12);
var validpress:boolean = true;
(var i:int = 0; < invalidframes.length; i++)
{
trace('checking if invalidframe[' + invalidframes[i] + '] == [' + this.currentframe + ']');
if (invalidframes[i] == this.currentframe)
{
trace('invalid frame matched, press invalid');
validpress = false;
break;
}
}
if (validpress)
{
trace('no invalid frame detected, running nextframe()');
nextframe();
}
}
function menufunc(a:mouseevent) :void {
gotoandstop(1);
}
please :s
it looks may skipping (ie, not playing) frame menu_btn etc when click @ least 2 of frame 1 coded buttons.
why isn't code in frame 1?
More discussions in ActionScript 3
adobe
Comments
Post a Comment