|
-
Creating a 'don't show this again' checkbox
Hi Everyone,
I'm working on a mini-site in Flash CS3 AS2. I have an opening page with some info on it and I'm required to have a 'don't show this again' checkbox there. So far I have placed a checkbox from the components window onto the stage and have been able to change the default text 'checkbox' to 'don't show it again' in the component inspector's parameters but that's about all I've done. I can imagine that I'd need to convert the checkbox into a movie clip and create 2 labels on the timeline as 'checked' and 'unchecked'? But then where do I from there?
Many thanks
-
Senior Member
the checkbox component will automatically change staes when its clicked on..
you would use a LISTENER to 'listen' for this change...and then act accordingly..
IMHO.. you would need to set a SO (Shared Object...ie: flash cookie) on the users machine and check for it each time a visitor comes to the site..
-
Cheers for that whispers,
I understand the what I need to do by now but I think I just don't know how to... Setting a shared object or creating a listener, event handler, where do I place the action? What do I type? I don't know how to talk to Flash is my problem it seems. I've been trying to get it for more than a month now... Do you think you could help me with this? Or even an idea on where I can turn to get help via chat or something, step by step instructions...
-
Prid - Outing
Give the Checkbox Component an instance name of for example, my_box, and then copy and paste this code on the OK button:
Actionscript Code:
on(release){ not_again = SharedObject.getLocal("not_show_again"); if(my_box.selected == true){ not_again.data.show_msg = false; } else { not_again.data.show_msg = true; } }
Then, get out of the movieclip with the 2 frames, and click on that movieclip once, open Actions panel (F9), and paste this in there:
Actionscript Code:
onClipEvent(load){ not_again = SharedObject.getLocal("not_show_again"); if(not_again.data.show_msg == false || not_again.data.show_msg == undefined){ gotoAndStop(1); // or frame where checkbox is displayed } else { gotoAndStop(2); // or frame where checkbox is removed/deleted } }
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
-
Senior Member
umm.. 'I' wouldnt do that...
no need to use on(press)....ever.. all code should be in a FRAME.. (not placed ON an object)..
and code should target an object by its INSTANCE NAME
plus,, never use onEnterFrames.. they are garbage.. (especially when left to keep running and running and running).....etc.......etc
try this:
actionscript Code:
//load your sharedObject called 'displayCookie' var mySharedObject:SharedObject = SharedObject.getLocal("displayCookie"); if(mySharedObject.data.displayed == true){ //do whatever IF already been played..like DONT show something trace("cookie found"); }else{ trace("cookie not found, setting it now"); //do whatever if NOT already been played mySharedObject.data.displayed = true; mySharedObject.flush(); }
its really just that simple.
try using [F1] in your FLASH IDE and reading..
or search here for shared object..
or even look in my footer form some links on how to use it!
-
Prid - Outing
I know that all code should be on frames, but since the OP seemed abit new to Flash, I thought I should leave out instance names, and just place them on objects instead. And I didn't use onEnterFrame, look closely, onClipEvent(load)
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
-
Senior Member
ahh..yes you are correct.. (I thought I saw onEnterFrame.... as you like to use that all the time in other code/posts)
and (IMHO) showing code design that is bad form is just 'bad form' regardless of the OP's skill set.. teaching them correct way from the beginning is best.. teach them to use instance names (its better and correct)
but whatever..
-
Thanks for your time and efforts guys...
Nig 13, you might laugh at me and please do! What is the 'OK' button? Did I create it? Where is it? I'm referring to:
Give the Checkbox Component an instance name of for example, *my_box*, and then copy and paste this code on the *OK* button:
Cheers!
PS. I have Flash at work and for some reason the help section is completely empty. I've had a feeling forever that it's been installed not right. And I have been reading so much on Shared objects etc for the past month that as far as I know myself, If I didn't get it till now, I'm not gonna get it without some old fashioned step step by help
-
Prid - Outing
Hi,
well, I thought by a Don't read this again chechbox, you meant that you had a small box appearing with a message in it, and you press OK to remove it, and in that box that appears, a checkbox labeled "Don't show this again" is also present there, but it seems you have something different - would you mind sharing the FLA file or describe your "don't show this again" checkbox? 
Oh, well, I started on a Flash interactive movie, to explain SharedObjects to someone, a few months ago, but never completed it - maybe I can complete it later today (not home right now) and provide you it
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
-
I might not be explaining myself correctly, thanks so much for asking for the flash file, I have played with the file much since I asked the question but I doubt that I changed much of it. Here it is:
http://www.mediafire.com/?rxykmf4xo6t0bla
I'll be waiting for the life saver interactive Shared objects movie! Thank you
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|