Where should I put my code?
Where should I put my code, on the buttons and other items in question, or in a separate Layer, referencing the items I need...?
Background :
I'm REALLY new to Flash with Adobe. I've used SwishMax a little in the past, but nothing of recent.
At work there's a project where I'm getting to use FlashPro CS6 and I've run into an odd issue with code to move forwards, backwards, and back to the beggining on 3 different buttons.
It's in a layer called Actions, and on frame 1 - And remember... uber newbie here folks, so forgive any glaring issues in my code that most people would see quickly...
//NEXT BUTTON
NEXT_BUT.addEventListener(MouseEvent.MOUSE_DOWN, nb_mouseDownHandler);
function nb_mouseDownHandler(event:MouseEvent):void
{
this.nextFrame();
}
//MAIN MENU BUTTON
MAINMEN.addEventListener(MouseEvent.MOUSE_DOWN, mm_mouseDownHandler);
function mm_mouseDownHandler(event:MouseEvent):void
{
gotoAndStop(1, "Scene 1");
}
//BACK BUTTON
BACK_BUT.addEventListener(MouseEvent.MOUSE_DOWN, bb_mouseDownHandler);
function bb_mouseDownHandler(event:MouseEvent):void
{
this.prevFrame();
}
The code for the first two work's exactly as I need, the code for the back button, initially it only appeared on from the second frame onwards, but during debugging I've popped it on all pages. On the first frame, it takes you back to a black page with nothing on it, on all others it does absolutely nothing...
Another question as I've written above, should my code be in a separate layer regerencing the items it needs to affect, or... as a colleague told me in a ridiculously over the top brimming with distaste, create layers for each item, or groups of items and place the code in there... which to me, see's odd...
Thanks once again in advance, and I'm sorry to post such a newbie question, but the internet gives mixed anwers, not specific to my situation.
Tim.
