I've never posted anything before so I hope I'm in the right place! Just
wanted to know if anyone could help me out with this query.
I created a flash slide show image gallery, following the tutorial step by
step from the following link:
http://www.layersmagazine.com/flash-slideshow-image-gallery.html
When I go to preview the slide show, I get the following error message:
"1119: Access of possibly undefined property onPress through a reference with
static type flash.display:SimpleButton."
Code is copied exactly as it is from the link (code as follows):
stop();
//next button
next_btn.onPress=function(){
if(mc_content._currentframe==mc_content._totalframes){
mc_content.gotoAndStop(1)
}else{
mc_content.nextFrame()
}
}
//last button
last_btn.onPress=function(){
if(mc_content._currentframe==1){
mc_content.gotoAndStop(mc_content._totalframes)
}else{
mc_content.prevFrame()
}
}
It seems to have a problem with the function "next_btn.onPress=function(){"
but I'm not really sure how to amend it!
Any ideas would be a huge help! :)[b]Text[/b]
Noelbaland - 10 Jul 2008 06:57 GMT
Hello there,
You need to close some lines with semicolons(;)...
here
mc_content.gotoAndStop(1)
here
mc_content.nextFrame()
here
mc_content.gotoAndStop(mc_content._totalframes)
and here
mc_content.prevFrame()
Should look like the following
Searz24 - 10 Jul 2008 07:05 GMT
Hey,
Thanks heaps for your response. Gave it a try and unfortunately no luck hehe.
Not sure where to go from here now... perhaps there's something missing from the tutorial??
Noelbaland - 10 Jul 2008 07:15 GMT
Try stretching your actions layer to the same as the last frame of your images.
In the tutorial (in Step 8) the actionscript is on one frame. It should cover
all frames in the movie so as to not lose focus. Go to the last frame of your
movie (where your last image should be) and hit F5 to add frames. Test your
movie.
Noelbaland - 10 Jul 2008 07:19 GMT
Sorry - what I should've said is that your actions layer should be the same length as the other layers.
Searz24 - 10 Jul 2008 07:22 GMT
Tried that one as well... still no luck!
The movie does load, however, the images just keep looping - they don't stop
where they are supposed to, so that you can use the buttons to either select
the next image or the previous.
I've tried placing stop(); after each frame in the movie as well and this
hasn't worked (was worth a shot!)
Should I have a stop(); anywhere else??
Noelbaland - 10 Jul 2008 07:31 GMT
What version of Actionscript and Flash are you using?
Searz24 - 10 Jul 2008 07:38 GMT
Actionscript 3.0 and Flash CS3
Noelbaland - 10 Jul 2008 07:47 GMT
The code in the tutorial was written for Actionscript 2.0. Never mind all you
need to do is change your Publish settings to Actionscript 2.0. Change the
Flash Player to 8 if you're still having a problem in 9 (but you shouldn't).
Searz24 - 10 Jul 2008 07:56 GMT
Ah success!! All working perfect!
You are an absolute gun! Thank you so much for your assistance... I am very grateful :)
Noelbaland - 10 Jul 2008 07:59 GMT
Excellent! You are welcome