Jump to content


Where to put this code?


  • You cannot reply to this topic
3 replies to this topic

#1 futeballer

    Young Padawan

  • Members
  • Pip
  • 9 posts

Posted 03 August 2006 - 06:11 PM

Okay so I searched around and finally found a code that would stop my flash header from reloading everytime I changed the page on my website and it goes like this:

function checkSO()
{
// If a shared object called siteSO already exists this will retrieve it otherwise it
// creates a new shared object called siteSO
var SO = SharedObject.getLocal("siteSO");
if(SO.data.visitedAlready)
{
gotoAndPlay("end");
}
else
{
SO.data.visitedAlready = true;
SO.flush();
}
}
checkSO();

I'm guessing I have to put this in the first frame? Just a stupid question though.. which layer do I put it on, or does it not matter?

Also I believe I need to put
 end
on the last frame but again which layer to put on?

:P :P :(

#2 funkysoul

    The Funky Stuff

  • Publishing Betazoids
  • PipPipPipPip
  • 2,307 posts
  • Gender:Male
  • Location:Zurich, Switzerland
  • Interests:Music: HIM, HIM, HIM, Cafe del Mar, Linkin Park, Fort Minor, Coldplay, Eric Jordan<br />Sports: Snowboarding, KiteSurfing, Extreme Sports<br />Computer: Flash, After Effects, Actionscript

Posted 03 August 2006 - 06:45 PM

create an actions layer on the root timeline and place your actionscript at the first frame, keep in mind that the actions layer is located as top layer.

#3 icio

    Young Padawan

  • Members
  • Pip
  • 10 posts
  • Location:Perth, Scotland

Posted 04 August 2006 - 12:50 PM

It doens't really matter which layer you put it on, but I think the top-most layers have their actionscript executed first.

#4 funkysoul

    The Funky Stuff

  • Publishing Betazoids
  • PipPipPipPip
  • 2,307 posts
  • Gender:Male
  • Location:Zurich, Switzerland
  • Interests:Music: HIM, HIM, HIM, Cafe del Mar, Linkin Park, Fort Minor, Coldplay, Eric Jordan<br />Sports: Snowboarding, KiteSurfing, Extreme Sports<br />Computer: Flash, After Effects, Actionscript

Posted 05 August 2006 - 07:40 AM

It's better to put all actions on the topmost layer, flash loads the layers in that way..





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users