Back again with another very basic issue. I just created a button in flash. A very basic button. where I selected a rectangle with some text and the converted them into a symbol, namely button. Then I gave the HOVER UP DOWN different colors. The button was made and worked correctly visibly. Changed colors on mouse hover and mouse down. However when I tried to add some code to it using on(press) function, the functionality did not work.
Then I chose a button from the buttons library that comes with flash and tried the same functionality and it worked !!??
So why is the functionality in the i designed not working ? Any ideas?
Thanks !
PS. How can I attach my file with my question or is that not possible ?? I would like to attach the file here or somewhere if possible so that anyone may be able to see and check it out? Thanks again.
Not sure why it wouldn’t work. Are you sure there aren’t any typos in the code? If you directly copy and paste all the code from the flash library button and put it on your button, does it work then? You can also try right-clicking on the library button and selecting “Swap Symbol” and selecting your custom button and see if that works.
As far as attaching your file, you can’t do it with flash files here, only images (as far as I know). So if you want to share your file, you need to upload it somewhere else and share a link. However, I wouldn’t depend on files for your questions. I, for example, never download and open FLAs or other files from untrusted sources.
Thanks for the reply. There is hardly any code. In fact it is just this:-
on(press)
{
gotoAndPlay(“rc”);
}
and there is a stop(); in both the frames. So the movie loads and stops and the button press sends it to the next frame named “rc” and it stops there again due to the stop() in that frame.
In fact I copied the code from the non - working button into the working button. So no chances of a typo.
I have this feeling that there is something maybe in the preferences that has to be set to get the buttons working.
Anyways I’ll try and redo the whole thing in a new file and see what comes out of it. Thanks very much for the reply and suggestions.
I found the problem and would like to put it here for others like me in the process of learning flash.
The problem was with a property called “linkages” in which I had checked a checkbox against “Export for flash”. This needed to be unchecked. I found this upon comparison with a button from the library. While this solved the problem of my button, I have no clue as to what linkages is about and why unchecking the said option solved the problem.
To get to linkages, please use Ctrl+L to open the library box and right click on the name of the desired button to open a menu and therein you can find “Linkages”.
If someone has any idea about this then please share it here.
linkages let you dynamically create movie clips from code with attachMovie rather than having to place them on the timeline.
If I remember right, you can’t use them with Button symbols, only MovieClip symbols. So by giving your button a linkage identifier, it looks like you somehow broke it. I was a little surprised the code fails, but then again it sounds vaguely familiar too. Its been a long time since I used AS2.