Log in

View Full Version : Help - New to flash



LakeGraphics
08-13-2008, 02:51 AM
Hi I came across this tutorial online that seemed fairly simple. It was to create a slide show type of gallery where I could create buttons that would scroll through the images in both next & previous directions. I am having troubles. I came across help here on the forum that looked like it was helping someone else with the same situation. Here is the code I have for the script on the buttons.


// next button
next_btn.onPress = Next;
function Next() {
if (mc_content._currentframe == mc_content.totalframes) {
mc_content.gotoAndStop(1);
}
else {
mc_content.nextFrame()
}
}

//last button
last_btn.onPress = Last;
function Last() {
if(mc_content._currentframe == 1){
mc_content.gotoAndStop(mc_content._totalframes)
}
else{
mc_content.prevFrame()
}
}

//setInterval
setInterval( Next, 5000 )

I keep getting an error when i publish that says
"Access of possibly undefined property onPress through a reference with static type flash.display:SimpleButton."

Being new, I have no idea what that means, & I can't figure out where I've made an error. I can send the .fla file as well to see if it will help. Any help that can be provided would be greatly appreciated. I'm just trying to get a decent gallery up for my sign business and its driving me crazy.

Thanks in advance

Medyman
08-13-2008, 01:06 PM
That error is an AS3 error. Your code looks like AS2.

Go to File > Publish Settings and change the output to ActionScript 2.0.

LakeGraphics
08-14-2008, 01:59 AM
Medyman...you da man. Many thanks

loginn
08-18-2008, 11:46 AM
That error is an AS3 error. Your code looks like AS2.

Go to File > Publish Settings and change the output to ActionScript 2.0.

Really an expert!!

admire you......