PHP MySQL ebook
February 12, 2011 – 4:57 pm | No Comment

Hey everyone!!
With this section I hope to share with you resources which I have tried and valued
So you’re new to PHP and want to learn from scratch. Well I was in your position not too …

Read the full story »
SEO Tutorials

Need help with Search Engine Optimisation? This is the place to look for the latest tips and hints with the advice we offer. Keep an eye out here for the latest posts.

PHP Tutorials

Learn how to code with PHP to achieve your goal. In here I aim to show and teach you about little tips and tricks that should enhance your coding abilities

Flash Tutorials

Learn how to use Adobe Flash for your own purposes. Little tips and hints to help you along

Website Development

In here I aim to help you with developing your website from scratch. Come here for various tips and pieces of advice to help you build and improve your website.

Home » Featured, Flash Tutorials, PHP Tutorials

Flash Cookies

Submitted by on July 29, 2007 – 3:20 pmNo Comment

OK here is how to create a cookie in Flash backened with PHP.

Firstly we start with the Flash file.

1. Create a flash button. To do so draw a rectangle, right click on it and select make symbol. select button then press ok.
2. In the action panel of the button add the following:

Actionscript:
  1. on (release) {
  2. cookie = "flashsite";
  3. getURL("input.php", "", "POST");
  4. }

3. On the action for the frame add the following:

Actionscript:
  1. cookie = "value";

4. Now you have set a variable as soon as the SWF loads called cookie, when you press the button it changes to flashsite. the seconline takes you to input.php where it sees the variable and acts upon it.
5. My input.php looks like this:

PHP:
  1. $cookie = $HTTP_POST_VARS['cookie'];
  2.  
  3. if($cookie == 'flashsite')
  4. {
  5. setcookie("asgsoft_redirect", $cookie, time()+31536000);
  6. header("Location: index.php");
  7. }
  8. if($cookie == 'nonflash')
  9. {
  10. setcookie("asgsoft_redirect", $cookie, time()+31536000);
  11. header("Location: nonflash");
  12. }
  13.  
  14. if($cookie == 'skipintro')
  15. {
  16. setcookie("asgsoft_redirect", $cookie, time()+31536000);
  17. header("Location: index.php?scene2");
  18. }
  19.  
  20. ?>

6. This is part of mu upcoming site where it allows the user to select whether to see flash/nonflash site. if they select flash then whether to see the into or not.

I hope this has been helpful to somebody

VN:F [1.9.17_1161]
Rating: 9.2/10 (6 votes cast)
VN:F [1.9.17_1161]
Rating: +1 (from 3 votes)
Flash Cookies, 9.2 out of 10 based on 6 ratings
Be Sociable, Share!

Popularity: 100% [?]

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.