Cookies In Flash Vs SwapDepth
Cookies vs swapDepth? What I am hoping to do is probably very simple for you Pro's, but it is not that clear to me. I designing a menu system one that is called via clicking on a button labeled "Launch Menu" Once the menu is loaded - it will hover over what is on the screen. Once the user selects an option the menu goes away. Clear enough so far? If not let me know.Here is where the subject of this post comes in. When the use calls th menu again - I want it to be at the same exact area it was from when it was last called? The question: Do I achieve this using Cookies or Do I just use swapDepth? Thank you for any help you can offer and if it is not so much trouble a sample script would put it in perspective for me. Thanks a million to anyone who can help.
KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 03-11-2006, 03:32 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Cookies Vs SwapDepth
Cookies vs swapDepth? What I am hoping to do is probably very simple for you Pro's, but it is not that clear to me.
I designing a menu system one that is called via clicking on a button labeled "Launch Menu" Once the menu is loaded - it will hover over what is on the screen. Once the user selects an option the menu goes away. Clear enough so far? If not let me know.
Here is where the subject of this post comes in. When the use calls th menu again - I want it to be at the same exact area it was from when it was last called?
The question: Do I achieve this using Cookies or Do I just use swapDepth?
Thank you for any help you can offer and if it is not so much trouble a sample script would put it in perspective for me.
Thanks a million to anyone who can help.
Server Side Script Cookies Or Flash Cookies?
Hi,
a have the whole page written in ASP and now I'm redesigning it with flash, but the background is asp. In asp i have a login system, which writes a cookie, when a user logins. I also have a poll, which also uses a cookie to prevent double voting. Is it better to send a cookie value to flash as a variable and according to this value the flash opens, hides, etc the movies, objects, or is it better to write cookies in flash?
Cookies And Checkbox... Cookies? I Like Cookies
heres my problem. i have different swfs loaded into a main movie and when you roll over the title it shows the content and when you roll out it disappears. and i also have a show all button so that all the content is shown and the rollovers and what not are diabled. what i want is a checkbox that they can check and the next time they come back the content will be shown instead of hidden. (it will remember their preference)
SwapDepth On An MC That Contains An On(press) SwapDepth Within
On my main stage I have 6 MCs, triggered by menu buttons and all on the same layer. Each of these MCs is a draggable window using this code:code: on (press) {
startDrag("/dragMC1", false);
_parent.depth++;
this.swapDepths(_parent.depth);
}This works perfectly.
Now, I'm trying the make it so when you press the menu, that the chosen window loads on top.
I've tried a few things, and the closest I come is have the chosen window load on top, which is what I want, but it cancels out the above code.
Any help on this problem will be greatly appreciated.
Flash Mx 04 - SwapDepth Problem
Hi all,
I am having a slight problem with the following kirupa tutorial:
http://www.kirupa.com/developer/actionscript/swapdepth.htm
I'm trying to create a windows style interface which consists of 17 windows (not all showing at the same time).
by following the tutorial I have managed to get windows to jump to the top (z axis) when clicked on - no problems.
What i am experiencing though is that windows seem to interfere with each other.
For example i have windows a,b,c and d visible, with 'a' at the top, then 'b', then 'c' then 'd' at the bottom.
Lets say I click on 'c', it should jump to the top leaving the order c,a,b,d.
'c' does jump to the top but it brings 'b' with it making the order c,b,a,d.
I have checked all instance names etc and see no reason why 'b' should interfere with 'c'. The more confusing thing is that it is not always 'b' that jumps with 'a' sometimes its 'a' or 'd'. It seems to be random.
As I have 17 windows you can imagine how messy its all getting - arrgggghhh!
Not sure if my explanation makes enough sence - sorry.
Has anyone experienced this before?? Any help would be greatly appreciated before i smash my computer around the office.
Thanks
Cookies In Flash
does anyone know how i can pass a cookie variable into a flash url? i've been driving myself nuts trying to figure this out.
please help!!!
Cookies And Flash
Howdy,
I want the following to occur with my new web site.
When the user first visits the site they see my splash page etc. Upon subsequent visits they are sent directly to the main navigation page (also done in flash) instead of having to wait through the splash animation. I figure I'm going to need cookies but how could I get this done specifically. Any advise, tutes or code would be appreciated.
cheers,
Flash & Cookies
I want to play a sound on a menu for http://www.alcobuds.com - its a girl sayinf Welcome to Alcobuds.com.
This is working at the moment - but I want to work it so it only plays once per person - ideally they get a cookie on their PC stating not to play the sound again - question is - is this possible?
If so, how - and do I need to play the sound seperate from the Flash file to do it.
Please help -no experience with cookies.
Cookies And Flash...
I made a game that stored cookies on the computer (marketing reasons) and it worked good and well. Then it all got replaced by an older version, by mistake, and now it won't work and I don't know why. Here's what I did:
1. Check to see if new user
2. If new user = true then ask for details then start game
3. If new user = false then use the username as player name and start game
...pretty straight forward. IT DOESN'T WORK! AAARRGGGHHH!!
It doesn't seem to recieve the "new_user" command from the asp. It is definately not the ASP or cookie side thats the problem, it definately IS the flash code. Can anyone help. Below is the code I am using, and the problem can be see at http://www.matmi.com/games/pigs.html (you will notice it asks for your name and email address, even when you've already done it, and refreshed the screen):
loadVariables ("email/check.asp", this, "GET");
if (new_user=="true") {
nextFrame ();
} else if (new_user=="false") {
stop ();
gotoAndStop (1); (where its hidden)
_root.name = name_2_use;
}
Cookies In Flash?
is it possible for flash to create and retreive cookies? Anyone have a link to an example of how to do this? Thanx!
-Ryan
Flash, ASP And Cookies
could someone give me an example of how to communicate the action of assigning a variable to a cookie through a button action using the post command and also retrieving the value of a cookie to activate a "tell target" event in flash 5? i would really appreciate a working example from anywhere...i've got an asp page that creates the cookie and both pulls and assigns the cookie values so i need Flash to communicate with this ASP page. thank you very much.
Cookies And Flash 5
I made a site, and the backgroun can be either green or yellow. I was wondering, if someone picks yeallow, how can I get it to be yellow the nect time they come to th site?
I no there are cookies involved, but I can't fined a tutorial on them anywhere.
SO the question is, how to get the site to be yellow (tho it's green by default) if they choose yellow, the next time they come.
HELP!
Cookies With Flash
if you know of a good tutorial, site, or example of how to integrate cookies with flash could you please let me know? also, if you've had experience with this please post.
Thanks in advance.
Cookies With Flash
Hello Flash Cookers
I have found an flash example of how to make a cookie...
It works great... but the code to read if there is any cookie is :
getURL("javascript:if(document.cookie.length<1){al ert('No cookie for%20this site.')}else{alert('Your Cookie is:'+document.cookie)}");
but it seems that it only deals with the HTML page... and I have an alert Box wich tell me if I'm cooked or not !
Instead of alert('No cookie for%20this site.') I would like to have myFlash.gotoAndStop("no cookies");
I have tried to replace the lines, but it doesn't works because I'm mixing javaScript with actionScript....well I guess !!!
Does anybody know how to cook it....
Thank's
the JavaScript in my HTML page is:
<SCRIPT LANGUAGE="JavaScript1.1">
<!--
// Get Cookies script
cookString = "?"
// does the visitor have a cookie?
if(document.cookie != "") {
theCook = document.cookie.split("; ")
// add each part of the cookie to a string variable
for (i = 0; i < theCook.length; i ++) {
cookString += theCook[i] + "&"
}
}
// -->
</SCRIPT>
Cookies With Flash
Hello Flash Cookers
I have found an flash example of how to make a cookie...
It works great... but the code to read if there is any cookie is :
getURL("javascript:if(document.cookie.length<1){al ert('No cookie for%20this site.')}else{alert('Your Cookie is:'+document.cookie)}");
but it seems that it only deals with the HTML page... and I have an alert Box wich tell me if I'm cooked or not !
Instead of alert('No cookie for%20this site.') I would like to have myFlash.gotoAndStop("no cookies");
I have tried to replace the lines, but it doesn't works because I'm mixing javaScript with actionScript....well I guess !!!
Does anybody know how to cook it....
Thank's
the JavaScript in my HTML page is:
<SCRIPT LANGUAGE="JavaScript1.1">
<!--
// Get Cookies script
cookString = "?"
// does the visitor have a cookie?
if(document.cookie != "") {
theCook = document.cookie.split("; ")
// add each part of the cookie to a string variable
for (i = 0; i < theCook.length; i ++) {
cookString += theCook[i] + "&"
}
}
// -->
</SCRIPT>
Cookies And Flash
could anyone help me with a code that
1. On first use, it writes a cookie to your computer
2. All other times after that, the movie reads the cookie, and starts the movie from the main screen (main) not the intro (intro)
is it possible to do this!
thanks in advance
dkeegh
Flash Cookies
I want the name of the cookie to be the name of the flash file that is setting the cookie. How do I get the name of the flash file from flash within flash?
thx.
Cookies And Flash MX
OK. I have a site that sets a cookie to mark when they have viewed the splash intro (flash), then it redirects to new page. On that link I need to have a button in flash that will reset the cookie so if they want to view the intro again they are able to. I can't seem to get it to work. Any ideas. Here is my cookie script on the intro page:
Quote:
<script language="javascript">
<!--
// page to go to if cookie exists
go_to = "main.html";
// number of days cookie lives for
num_days = 60;
function ged(noDays){
var today = new Date();
var expr = new Date(today.getTime() + noDays*24*60*60*1000);
return expr.toGMTString();
}
function readCookie(cookieName){
var start = document.cookie.indexOf(cookieName);
if (start == -1){
document.cookie = "seenit=yes; expires=" + ged(num_days);
} else {
window.location = go_to;
}
}
readCookie("seenit");
// -->
</script>
In the flash movie I have this attached to a button:
Quote:
on (release) {
getURL("java script:setCookie('seenit, 'no');");
}
Do I need some additional script in the HTML of the page that is displaying the flash button to reset or delete the cookie?
BTW I am not using PHP or ASP, just plain ol HTML and Flash..
Flash Cookies
is there any way to share flash cookies??
i have one movie that writes the cookie, and i have another that wants to be able to read it. but i'm getting nothing because I guest the cookie is specific to the movie.
any way around this?
Cheers
B
PHP Cookies In Flash
Anyone know if there is a way to read a PHP cookie with Flash, and send it from a form??
Thanks in advance.
Help With Flash And Cookies Php
Hi, i got a problem i'm trying to pass a var loaded from a cookie, with purpose that if the var called sepuede = "No" then the movie swf should go to the Secene "Animaciones" , frame 253. and if the var called se puede then go to the Scene "Animaciones", frame 1.
This is the code in php:
Code:
<?php
session_start();//iniciamos la sesion
if (isset($HTTP_SESSION_VARS['numerito'])) {
if ($HTTP_SESSION_VARS['numerito'] == 0){
setcookie("cuenta","No");
} else {
setcookie("cuenta","No");
}
}
else {
$HTTP_SESSION_VARS['numerito']=0;
setcookie("cuenta","No");
}
?>
<param name="movie" value="flash/principal.swf" />';
<param name="quality" value="high" />
echo '<param name="FlashVars" value="sepuede=<?php echo(urlencode($HTTP_COOKIE_VARS["cuenta"]));?>"/>';
echo '<embed src="flash/principal.swf" FlashVars="sepuede=<?php echo(urlencode($HTTP_COOKIE_VARS["cuenta"]));?>" quality="high" type="application/x-shockwave-flash" width="729" height="618"></embed>';
</object>
This is the code in swf:
Code:
onClipEvent (load)
{
//total = total de bytes de la pelicula
total = _root.getBytesTotal();
var sepuede:String;
}
//al entrar en el frame
onClipEvent (enterFrame)
{
loaded = _root.getBytesLoaded();
percent = int(loaded / total * 100);
text = percent + "%";
gotoAndStop(percent);
if (loaded == total) {
if (sepuede == "No"){
_root.nextScene();
_root.gotoAndPlay(253);
} else {
_root.nextScene();
_root.play();
}
} // end if
}
I tried with _root.gotoAndPlay("Animaciones",253); or gotoAndPlay("Animaciones",253); but nothings happend i have been working four ours without results
I hope someone can help me and thank you for your time
Flash Cookies?
I created a flash header that controls 2 submenus which navigates through a static html based site. The header submenus are placed in 2 separate movie clips that change when you click the appropriate button.
My goal is to keep the submenu content the same when a user clicks a submenu bttn and is directed to another html page and not to reset the submenu back to the initial submenu choices...
For example:
When you 1st land on the home page the flash header submenu is set to "Categories" submenu, the other sub menu set is "My Account" choices. If a user clicks the "My Account" button the categories submenu changes to My account submenu, when a user clicks a "My Account submenu choice he/she is directed to the appropriate page, however since the html based site refreshes itself, it sets the submenu choices back to the initial "categories" submenu, I want it to stay in the "my account" choices, how do i do this??
I was told that this can be accomplished using flash cookies or shared objects however i have no idea how to implement it.
thanks in advance
Cookies And Flash
ok So I have this game where you click on a button and i spins the wheel (like wheel of fortune). But I only want to set it so that a person can play it only once per day. and that's it...One spin Per day. Even if they close a browser. So it's obvious that I have to use cookies. I don't have much cookie experience at all. Is there a way of doing this easily?
Cookies In Flash?
Hi!
Is it possible to make a cookie that remembers if you have "visited" the flash or not?
Regards
Henrik
Flash Cookies
I know most people want to add cookies when people hit their websites but I want just the opposite. Whenever flash saves cookies from my website (at least that's what it seems to do) it messes up my front page which has images that change week to week (there are 3 and they end up all being the same image until you either reload the page a couple of times or scroll through to the next set of images and then back but even then if you leave the site and come back you have the same problem).
I know how to change my personal setting to not save flash cookies but I would like for people hitting my site who don't know how to change their settings to not have to worry about it.
Can anyone help me?
www.okhorizon.com
Flash And Cookies
I need some help, I have a button and when a user selects the button, I would like a cookie to be loaded onto there machine. Nothing fancy, just a cookie that does not expire, and secondly, I need the cookie to have a number. Now, when they select a different button, I want the cookie to be replaced with a new cookie, still no expiration date, but the number changes. I also, need some code, so that when they load the movie, it checks to see if they have a cookie, if they do, I need to bring the number from the cookie, and load it into a variable box in the flash movie.
Any idea's??
Thanks in advanced.
Late
Kelsey
Flash And Cookies
My site can be located at http://lowcostflashtemplates.com/catalog/[/F I need my flash file to play only once so that when a user clicks on new pages it does not repeat. I know that I must use cookies but Im not clear on how to code it.
I have a sound file that is set to event, I dont know if that will effect anything or not.
Also is there a way to set a time limit so that a user will not see the file repeat unless its been a day since they visited the site?
Thanks in advance!!
Edited: 11/26/2007 at 04:09:25 PM by Funks Da Burn
Flash Cookies
hi
i building a login page and i wana do cookies on it, which i wil be able to retrieve in the mainmenu page.
on the first frame of my login page i put
=====================================
user = SharedObject.getLocal("user_profile");
if (go == "true") { //login successful
user.data.login = "xuserid" ;
// xuserid is a userid i pass from a asp page
user.flush();
getURL("mainmenu.html", "_self");
}
if (go == "false") { //login unsuccessful
gotoAndStop("error");
}
=====================================
is this correct?
and then on the mainmenu.html page , i put on the first frame
===================================
user = SharedObject.getLocal("user_profile");
currentuserID = user.data.login;
===================================
is this correct?
because i cant seen to get the cookie working.. can someone help me please. thanx
Flash MX Cookies
hi .. anyone can help with cookies in flash MX ?
i have found the kirupa tutorial on flash mx cookies but if i am retrieving the cookie from another flash page, do i also do teh same thing?
that is i create teh cookie in one flash page
user = SharedObject.getLocal("user_profile");
user.data.name = name;
user.flush();
do i hav to create teh cookies by scripting it to a button like in teh kirupa tutorial?
then on another page i just write :
user = SharedObject.getLocal("user_profile");
name = user.data.name;
to retrieve the cookie?
Cookies In Flash?
Hey, i was just wondering, is it possible in flash to do stuff with cookies, set, edit, and stuff. I have a php app written up for tracking new and returning visitors. However, to keep from renaming the home page, and changing all the other pages in the site, i would like to access this page via flash on the home page. I dont know if you can have flash access the page and still have php set a cookie, so any help or ideas would be greatly appreciated.
Flash With Cookies-LSO
hi all
if soemoen is aware of teh local shared objects in flash please let me know.I wanna creat ea program in flash whcih stores a unique id for evvery visitor in flash.
thanks
Flash And Cookies
I'm working on an e-learning course built in Flash that will work in a SCORM environment. One piece of functionality that has been requested is to keep track of where a user has been.
For example, a student may login and work on a few lessons and then leave the course without finishing it. When they return to the course, they should be able to click on a button to take them back to where they were when they left the course or be automatically taken to that point in the course.
The only way I can think of this being done is with cookies, so Flash would have to communicate with the browser via JavaScript and drop a cookie at the start of the course. Upon re-entry, the JavaScript would need to get the cookie and detect a position left in the course and take the user to that point upon activation.
I've seen tutorials on bookmarking and some on getting flash to work with the back button in the browser, but that's not really what I'm looking for.
Has anyone had any experience with this?
Flash: PHP Cookies
there was a forum theme you used to be able to use that had a flash header that could retrieve your login name and info. is there a suggested code for this? I didnt find what i was looking for on google..
Cookies And Flash
ok So I have this game where you click on a button and i spins the wheel (like wheel of fortune). But I only want to set it so that a person can play it only once per day. and that's it...One spin Per day. Even if they close a browser. So it's obvious that I have to use cookies. I don't have much cookie experience at all. Is there a way of doing this easily?
Flash Cookies
hi all,
having some trouble...
Basically i have a flash popup form that externally loads onto another swf, thats not the problem. However i have a button on the popup that needs to close the flash popup on the screen aswell as set a cookie to not show that popup again until 24hours have passed.
How do i get this to work....shared object? or get flash to call javascript which sets the cookie?
any advice and work around would be much appreciated
Bigbalroo
Cookies In Flash?
Hey, i was just wondering, is it possible in flash to do stuff with cookies, set, edit, and stuff. I have a php app written up for tracking new and returning visitors. However, to keep from renaming the home page, and changing all the other pages in the site, i would like to access this page via flash on the home page. I dont know if you can have flash access the page and still have php set a cookie, so any help or ideas would be greatly appreciated.
Flash And Cookies
Hi all
I need help with creating a cookie and I wondered if anybody had some knowledge of this.
What I am trying to do is present the user with three pages when they land on the home page. Once they click on the flash button to which page they want to go to I want to set a cookie that will redirect them to the set page everytime they come back to the original home page. Also I want the cookie to expire in 30 days if they don't return.
Has anybody done this in Flash? Can you help?
Thanks a lot
Drew NoImage = NoSigImageNoImage = NoImageRes
Flash And Cookies
Hey,
This has always happened to me and I do not know why. If I make a flash movie and publish it to a website and then make changes to that flash movie and publish it again, sometimes it still shows the original movie. Do I have to delete cookies? If that is the case how would a user know? Is there any solutions.
Thanks,
mike
PLS Help: Flash & Cookies
Hi
I am just start learning flash and i have a class project in flash that requires cookie function in javascript by passing HTTP query string to Flash query string.
OK, here's the situation:
A user enters his name and company name, and when he click the 'Submit' button a new page opens which contains a flash movie saying "Hello <name>". The Flash movie is supposed to read the cookie. How do i make it in ActionScript so that the Flash will grab the name?
I have two html files: LOGIN.htm and COOKIES.htm
*** LOGIN.htm ***
<html>
<body>
<form method="GET" action="COOKIES.htm">
<p>Please enter your user name <input type="text" name="userName" size="20" value="Guest User">
<br>
Please enter your company name <input type="text" name="CompanyName" size="20" value="My Company">
<br>
<input type="submit" value="Submit">
<input type="reset" value="Reset"></p>
</form>
</body>
</html>
*** COOKIES.htm ***
<HTML>
<BODY>
<OBJECT classid="clsid:B27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://macromedia.com/cabs/swflash.cab#version=4,0,0,0"
ID=flaMovie WIDTH=200 HEIGHT=220>
<PARAM NAME=movie
VALUE="COOKIES.swf?userName=<%=Request.Cookies("userName")%>">
<PARAM NAME=quality VALUE=medium>
<PARAM NAME=bgcolor VALUE=#99CC33>
<EMBED src="COOKIES.swf?userName=<%=Request.Cookies("userName")%>"
bgcolor=#99CC33 WIDTH=200 HEIGHT=220
TYPE="application/x-shockwave-flash">
</EMBED>
</OBJECT>
</BODY>
</HTML>
Finally, on the first frame of the flash movie i put a static text says "Hello" and a dynamic text box with a var called userName
Did i miss something here???...
Writing Cookies With Flash
Hello all,
I want Flash to write cookies so it stores information of the user per computer and user preferences. I did go thru a couple of tutorials...but frankly I didnt understand it that well!
Can anyone be generous to share the best way of doing this!
thanx a ton!
Nixthinx
Cookies And Flash Part 2
OK well I figured out how to use cookies to redirect users who've already seen my page. Now I have another question.
I want to have the user input some data in flash which is sent to the cookie. When the user returns I want that data shown again through the flash interface.
ie.
First visit to the page user inputs the following in flash form...
Name=Rick
Last Name=Pitino
Email Address=celtsBetterWithoutMe@celtics.com
When user returns the screen may something like this...
"Hello Rick you are signed in"
Cookies/javascript With Flash
Would it somehow be possible in flash (possible by fscommand) to load a javascript function or something that is on the same page as the flash move is. I'm just curious is this is possible... if it is possible, you could have it call a cookie or create a cookie on the users browser which would be very cool. Just wondering if it's possible, or any suggestions on how to do this.
Can Flash Read Cookies?
Hey there!
need to know, can flash 4 read cookies? and if so.. how?
let me know if you can, thanks.
s
Read Cookies Into Flash
hey there,
okay, here's my problem - i have to read a cookie and get it's values into my swf for futher processing.
as far as i know, it's not possible to read out cookies directly from an swf...
i tried getting the cookie via javascript and load the values into flash by loadvariables, but this isn't working either, because obviously flash reads the source code and not the javascript output.
so far so good.... is there any way to get these values into my swf without using any server side scripting languages? (the file has to be running on a normal machine without any environments).
thanks for your time,
coda00 :)
Flash MX - Cookies For Sound
i have developed a site for my company http://www.coddo.com,
in which i have got this movie clip with on/off control.
in the navigation, each link loads a new swf file.
i want that when the user clicks the on/off music button
the information should get stored on the local machine.
for ex.if the user clicks on link1 and he clicks the off button, the music is stopped, after which if he clicks on link2, it should not load the music should remain off on the
link2 also.
at present every time the new swf gets loaded, the music is
also gets reloaded, because i am loading sound1.swf file on evry link file at the first frame.
i hope i have explained the question well, please help if anybody can.
Accessing Cookies From Flash?
Hi,
Is it possible to access Cookies from Flash? Or: How can I combine calling a JavaScript on the HTML page that than returns a value? (Probably need to append the return to the URL and reload the page.)
Any suggestions?
cYa,
Ivo
Cookies For A Flash Games
I was wandering how you would go about using cookies to remember the location of moveable charecters in a kids game. I'm unsure whether you can put javascript in with the ActionScript?????
Setting Cookies In Flash
<setting cookies in Flash>
Hello,
I have never posted before on flashkit, because normally when I have a question it is already posted here on the boards, but I could not find a ansewer to this question:
How can I set cookies in Flash (and retrieve them)
I have made a (pre-alpha)game:
http://scrappy.netfirms.com/lotr.swf
The most important option is missing: SAVING
could you please help me...
|