Subject: Help!! Should I use a SharedObject and How
Posted By: jplante Post Date: 1/22/2007 10:30:37 AM
Hello,  I am new to advanced Flash and ActionScript and I could use some serious help.  Here is my problem:  On a project I am working on, an xml file was written that contains an menu tree.   This tree contains menu that I want to expand and collapse.  When I click on a menu folder, the menu expands as expected.  When I click on a submenu link, the new page displays and the menu closes back up.  I have looked at the SharedObject class in ActionScript 2.0 but I am not seeing anything of benefit or any real detailed explanation of whether this is the path to follow.  Basically I am stuck.  Any wisdom you can relay to me would be greatly appreciated.  Thank you - JP


Reply By: harpua Reply Date: 1/23/2007 10:16:18 AM
I guess I am not seeing what you want to do with the SharedObject. SharedOjbect is basically the flash version of a cookie, used to store data on the users computer, example current page, current user id, users high scores, shopping cart info. So it is really down to what are you needing to store.
Reply By: jplante Reply Date: 1/23/2007 10:50:56 AM
Thanks for responding, I am not sure what I am doing at this point (it's always great to admit confusion).  I'll try to explain this the best that I can.

I have created an xml file that I am using as a side navigation menu.  Each node is a link to a specific html file.  In some instances clicking a link will open a sub menu.  This is where the problem arises.  When I click on a node (menu item) that has a sub menu attached to it, the node opens and the sub menu is displayed.  When I click on the sub menu item, I navigated to the intended html page, but the sub menu item is no longer displayed because the menu is collapsing back to it's original state.

As I said I am new to actionscript and I am driving myself crazy trying to figure this out.  Any insight would be appreciated.  Thank you again - JP

Reply By: harpua Reply Date: 1/23/2007 11:55:16 AM
Okay I see what is going on, I hadn't had any coffee. First off I don't know how your code is structured, so I would suggest setting it up like this, if possible.

A.Put the script that opens the sub menu item in it's own function. You have some type of variable telling it what you clicked. Then take your current button and call that open function sending the clicked variable to it.

B. In the open sub menu function create a ShareObject "flag" with the same defined variable that was sent to the function from the clicked button.

c. Go back to where your code loads and retrieve the SharedObject "flag". Then if it is not empty, have it call the open function.

So now the new page will open. Retrieve the SharedObject "flag" and call the open sub menu. I hope I didn't make this too confusing.

Reply By: jplante Reply Date: 1/23/2007 1:29:35 PM
I am confused but it's my own doing.  I do have a function created for that and I guess I'm just drawing a blank on where or how to implement the SharedObject component in that code and how to retrieve it.
Again I apologize for my ignorance, I just started working in ActionScript less than a week ago; I'm more frustrated at myself than the code and I'm developing tunnell vision.

Reply By: harpua Reply Date: 1/23/2007 3:22:15 PM
To find out about the SharedObject and it's properties I would look it up in the Flash Help Language Dictionary, that can tell you all the properties, and how to implement it and give a good explaination. I have not used it that much to be strongly familiar with it.

Inside your function have it write the cookie at some point.

1.When the flash loads at the top call the cookie

2 Then call your function like so.
MyMenuFunction(MyCookiePageFlag);

Reply By: jplante Reply Date: 1/23/2007 9:40:10 PM
Thanks so much for your help, I'll try to give it a try.  This little piece of code has driven me crazy.  Life would be so much easier if the was an ActionScript developer on site but......plus I have a feeling there's gotta be an easier way to do what I want....Again thank you so much.

JP

Reply By: jplante Reply Date: 1/24/2007 3:42:46 PM
Thanks for your help.  I've hit the wall.  I think I have become so focused that I've lost the ability to regroup.

Reply By: harpua Reply Date: 1/24/2007 4:28:34 PM
whats the problem? if you want you can send me the file offline and can see whats going on.
junk@eclecticpixel.com
Reply By: jplante Reply Date: 1/25/2007 8:05:41 AM
I would appreciate sending it on to you BUT my email client is refusing to deliver it.  I believe it may have something to do with the word junk in your email address.

Reply By: jplante Reply Date: 1/25/2007 8:11:36 AM
DUH!!!  Not enough coffee yet.  I just zipped ot out. Thanks again


Go to topic 55353

Return to index page 53
Return to index page 52
Return to index page 51
Return to index page 50
Return to index page 49
Return to index page 48
Return to index page 47
Return to index page 46
Return to index page 45
Return to index page 44