Adding visited and selected states to SimpleButton (Flash AS3)

How can I add visited and selected states, and a numerical ID to SimpleButton?
dlearman1Asked:
Who is Participating?
 
H01Connect With a Mentor Commented:
Hi dlearman1,

To my understanding you cant control the simple button behaviour because its behaviour is build in and you cant add 2 more states to it. The simple work around will be using movieclip as a button.

I attach a sample for you hope help you out
Button.txt
0
 
H01Commented:
Hi dlearman1,

Do you mean you wanna dynamically change a text box text a object state in a button?
0
 
dlearman1Author Commented:
Out of the box, SimpleButton has four state properties: upState, overState, downState and hitTestState. What I have in mind is adding two new properties  selectedState (indicating the button is currently selected) & visitedState (indicating the button has been previously selected).  In addition I would like to add a unique identifier, so the button can be part of a selection system like a dropdown menu, for example.

It seems that I might need to create a dynamic class like public dynamic class CustomButton extends SimpleButton.  But I would like to avoid the dynamic declaration if possible.  But I'm jsut not sure how to bet go at this.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
H01Commented:
Hi dlearman1,

If you want to keep track of the user behaviour you can use a movieclip in combine with SharedObject, SharedObject can keep track of user behaviour and movie clip we have more flexibility to control it, you can see the sample I attach.

SharedObject.txt
0
 
dlearman1Author Commented:
Thanks for your input.  I'm really not trying anything that exotic.  I just want to create a menu that will show visible states for visited and selected.
0
 
H01Commented:
Hi dlearman1,

Do you mean that after a user click on the button you want to change the button state to show that the user have click that button before? Correct me if I am wrong, because I still dont really get what you trying to do.
0
 
dlearman1Author Commented:
Yes that's pretty much it
0
 
H01Commented:
Hi dlearman1,

The flash it self cant really keep track of that because everytime when you refresh the page the flash will reload it self and everything will reset. unless you use sharedObject to keep track of which button being click b4 then when everytime your flash is reload it will go to check the sharedobject data first to determind which button should be show as previously visited state or selected state.
0
 
dlearman1Author Commented:
I'm not trying to track behavior from previous visits.  I just want to show two additional states (selected and visited) during the current visitor session. This is analogous to the up, over down states already built into SimpleButton.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.