Button does not publish correctly

Hmm, I’m having a problem with a button. I’m fairly new to using Flash and have to admit that I havent quite grasped scripting properly but am doing my best.

So my problem is that in my file I have a row of menu style buttons with all the same scripts:

on (press, release) {
_root.gotoAndPlay(“framelabel”);
}

to jump to a labeled frame within the movie. Now when I preview (ctrl-enter) everything works fine, but as soon as I publish the file, out of the six buttons five work and one doesnt.

I’m reallly stumped, but by the life of me cant work out why this is happening. Why does it work in preview mode but not when published??? Why do five of them work but only one with the exact same script not??? Am i thinking :block: ??

If anyone here has a solution for me, I’d greatly appreciate it.

Thanx in advance!

Okay… This is a long shot but you are sure the buttons point to different labels?

As in:
Code for button1

on (press, release) {
     _root.gotoAndPlay("label01");
 }

Code for button 2

on (press, release) {
     _root.gotoAndPlay("label02");
 }

And so on… Just to make sure you’re not using “framelabel” on all the buttons…

-M

*Originally posted by LilleMartin *
**Okay… This is a long shot but you are sure the buttons point to different labels?

… Just to make sure you’re not using “framelabel” on all the buttons…

-M **

First of all thanks for the quick reply LilleMartin, and it’s good to ask the most obvious solution first, which more often than not is also most likely to be the problem.

But, yes, it does point to different labels. I just put ‘framelabel’ as
a placeholder to make things less confusing… .

It was a long shot, but I’ve tried finding a solution for a long time now without luck, so the longer the shot the better - cheers anyway!

Anymore problem solving proposals most welcome!

Ok…
I think I’m spotting it now. instead of

on (press, release){

Try:

on(release){

That should take care of it…

-M

wow, that was quick again!!!

I’ll get right onto it!

Just a minute…

*Originally posted by LilleMartin *
**
Try:

on(release){

That should take care of it…

-M **

:-\ Sorry, it didn’t work - would have been too good!

What it is, I have a row of labels - let’s say from 1-5 and the button that causes trouble points to label 5 which works on preview but as soon as I publish it, the button doesn’t work because it stays at the first label 1 or jumps to it (?)… confused?
Me too!

:q:

Post the .fla file… I’ll see what I can do.
-M

*Originally posted by LilleMartin *
**Post the .fla file…
-M **

Ok, that’s what I dreaded…since I’m a newbie my fla file is quite big (lots of images & stuff - zipped 3.2mb) and the way I do things might not be the best way to go about it … but I’ll post or email it if the size is not a problem for you (e.g. your connection speed). Let me know what’s easier.

post some of your code instead…

Ok…
Go through this checklist, and if none of it works send me the file at martin@martinjacobsen.no

  • Check that the code is exactly the same as in the other buttons. Copy and paste it if you are uncertain.

-Check that the frame is properly labeled.
Check that the label’s name is correctly spelled both in the button and the label.

-Try switching code between two buttons. Copy the code from one of the buttons that work to the one that doesn’t. Does it work now?

-Check that the instance behaviour of the button isn’t set to graphic or movieclip by mistake.

-If the buttons is the same as the other buttons, try deleting it of the stage, drag a new instance onto the stage and enter the code again.

If nothing works (or you have already done all of this) send me the file.

-M

Ok, thanks for the list.

I’ll do it step by step and see what happens. Some of them I have tried already, but I’ll try again just to be sure. If all fails (hope not)
I’ll let you know before emailing it …

Cheers for all the advice.

:slight_smile: :slight_smile: :slight_smile:

Ok guys! This might interest you too! I found the problem!

After following all the steps LilleMartin suggested I still couldn’t successfully publish a version where the offending button worked…and just before I was willing to resign to my flash fate I decided to search once more at the macromedia site and forums. I came across this post:

macromedia post

where someone had a slightly similar problem with publishing…now it said that the problem only occured when publishing together with the html file…but the swf file was working fine.

So, here is me thinking - ‘yeah, let’s give that a try, maybe my swf file is fine after all…’ and guess what - running only the swf file the problem with the button had vanished. Did I however launch the file from the html, the problem came back!

Now taking my enquiry to the next level I went back to my publishing settings and checked to see what setting in the html template could be responsible for this. And the only one I could remotely think of was that ‘loop’ was unticked…

And publishing it again with the ‘loop’ option ticked, it worked fantastufaboulus!!!

After all I’m glad it finally works, and you probably can appreciate how I feel right now…I really am dancing on my table here.

So, thanks again for all the advice especially to LilleMartin (by the way, I checked out your website and it rocks…quite stylish) and I hope to be able to help someone else soon with my gathering flash knowledge…(but dont hold your breath…might take a while)

:beam: :beam:

So, thanks again for all the advice especially to LilleMartin (by the way, I checked out your website and it rocks…quite stylish) and I hope to be able to help someone else soon with my gathering flash knowledge…(but dont hold your breath…might take a while

No prob, and thank you. :wink:

-M