[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Adding visited and selected states to SimpleButton (Flash AS3)

Posted on 2009-02-12
9
Medium Priority
?
1,390 Views
Last Modified: 2013-11-11
How can I add visited and selected states, and a numerical ID to SimpleButton?
0
Comment
Question by:dlearman1
  • 5
  • 4
9 Comments
 
LVL 4

Expert Comment

by:H01
ID: 23629085
Hi dlearman1,

Do you mean you wanna dynamically change a text box text a object state in a button?
0
 

Author Comment

by:dlearman1
ID: 23629176
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
 
LVL 4

Expert Comment

by:H01
ID: 23629341
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:dlearman1
ID: 23629690
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
 
LVL 4

Expert Comment

by:H01
ID: 23630329
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
 

Author Comment

by:dlearman1
ID: 23630614
Yes that's pretty much it
0
 
LVL 4

Expert Comment

by:H01
ID: 23631025
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
 

Author Comment

by:dlearman1
ID: 23633549
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
 
LVL 4

Accepted Solution

by:
H01 earned 1000 total points
ID: 23639051
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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
Suggested Courses
Course of the Month20 days, 5 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question