Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > Adobe Web Programming > BOOK: Beginning ActionScript 2.0
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ActionScript 2.0
This is the forum to discuss the Wrox book Beginning ActionScript 2.0 by Nathan Derksen, Jeff Berg; ISBN: 9780764577680
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ActionScript 2.0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old January 22nd, 2007, 11:30 AM
Registered User
 
Join Date: Jan 2007
Location: Albany, NY, USA.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help!! Should I use a SharedObject and How

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 With Quote
  #2 (permalink)  
Old January 23rd, 2007, 11:16 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Oklahoma City, Oklahoma, USA.
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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 With Quote
  #3 (permalink)  
Old January 23rd, 2007, 11:50 AM
Registered User
 
Join Date: Jan 2007
Location: Albany, NY, USA.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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 With Quote
  #4 (permalink)  
Old January 23rd, 2007, 12:55 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Oklahoma City, Oklahoma, USA.
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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 With Quote
  #5 (permalink)  
Old January 23rd, 2007, 02:29 PM
Registered User
 
Join Date: Jan 2007
Location: Albany, NY, USA.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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 With Quote
  #6 (permalink)  
Old January 23rd, 2007, 04:22 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Oklahoma City, Oklahoma, USA.
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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 With Quote
  #7 (permalink)  
Old January 23rd, 2007, 10:40 PM
Registered User
 
Join Date: Jan 2007
Location: Albany, NY, USA.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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 With Quote
  #8 (permalink)  
Old January 24th, 2007, 04:42 PM
Registered User
 
Join Date: Jan 2007
Location: Albany, NY, USA.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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 With Quote
  #9 (permalink)  
Old January 24th, 2007, 05:28 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Oklahoma City, Oklahoma, USA.
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
Default

whats the problem? if you want you can send me the file offline and can see whats going on.
junk@eclecticpixel.com
Reply With Quote
  #10 (permalink)  
Old January 25th, 2007, 09:05 AM
Registered User
 
Join Date: Jan 2007
Location: Albany, NY, USA.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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 With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off



All times are GMT -4. The time now is 09:47 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.