all groups > flash actionscript > september 2005 >
You're in the

flash actionscript

group:

conditional logic with shared objects


conditional logic with shared objects desziner
9/21/2005 9:27:10 PM
flash actionscript: I have been successful in writing and retreiving data from a Shared Object. My
problem lies in accessing the lesson if:
A) the bookmark button is clicked
B) navigating thru the menu

If I use the bookmark button and retreive the SO data I am taken to my book
mark location, however if i navigate from the menu to the lesson the bookmarked
location opens.

How do I differentiate the code so the bookmark location only opens when I use
the bookmark button. Since I am saving the page number in the shared object, I
am using preloader code to specify the page location. When I navigate using the
menu I do not want to be taken to the book marked location.

loco = SO.data.currentLesson;
if ((loco == "lesson1.swf")&& (percent_done == 100)) {
gotoAndStop(SO.data.currentPage);
} else if (percent_done == 100) {
gotoAndStop(10);
} else {
gotoAndPlay(1);
}
Re: conditional logic with shared objects Jon Moyles
9/22/2005 12:00:00 AM
can you not just put this function on the 'bookmark' button and have done?
or are you talking about the ACTUAL bookmarks within your browser?
in that case you should set a variable whenever you press a button
within your navigation system and only execute this code if that
Re: conditional logic with shared objects desziner
9/22/2005 12:00:00 AM
Hello,
The bookmarks are not from the browser, it is done between swf files. Do I put
the preload code on the bookmark button? The swf that contains the retreive
bookmark button is a different swf from the lessons.
AddThis Social Bookmark Button