Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Try It Free
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 3rd, 2003, 06:08 PM
LANLord's Avatar
LANLord LANLord is offline
IT Dept Scapegoat
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 169 LANLord User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 54 m 43 sec
Reputation Power: 6
Loading Data into Combo Box from HTML

I saw the post about loading a combo box from SQL and I thought to myself that must be helpfull, but, ah... no.

Ok, I basically know enough to be dangerous. I understand certain thongs, but not really how to put them together, and I hoping someone out there will just give me a little bit of organization.

I have written a fairly extensive intranet in PHP and MySQL, but in order to navagate to anywhere within it within three clicks, I basically have a ton of links at the top of each page, eating a lot of real estate. Not Good.

The trouble is, the ENTIRE web site is db driven. Some stuff (different sections, links, contacts and archives, etc) are tied to the groups the logged in user is in, and some stuff (application defaults, preferences, etc) are tied to the user. When I wrote the site, I wrote it with the idea that nothing is available by default, and you only get what is specifically assigned.

On the light side, I wrote a navigation panel in flash. It's small, easy to navigate, and I think it will add order where there was some chaos. This is good.

As I said, everything is data driven, so I have to figure out how to pump the data in. Since I don't want to write to an external file, I'm guessing I need to build PARAM tags and add attribute/value pairs to the EMBED tag inside the OBJECT tag. I can do that very easily. Then it seems I need to do something with loadvariables, but I'm not sure what nor do I know where to put the actionscript.

One of the things that puzzles me is how do you keep the swf from reading the variables over and over? Put the actionscript in a layer by itself? But what happens when it loops?

Anyway, TIA. Wether I get an answer or not, I will probably troll this forum. I can help with networking, PHP, MySQL.
__________________
Thanks,
CF

Reply With Quote
  #2  
Old August 3rd, 2003, 06:25 PM
LANLord's Avatar
LANLord LANLord is offline
IT Dept Scapegoat
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 169 LANLord User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 54 m 43 sec
Reputation Power: 6
Found on Yahoo:

Code:
Hi Philip,

Pass the variables as parameters to the Flash Movie like this:

<param name="movie"
value="flash/sondagem_dummy.swf?var1=value&var2=value&var3=value">

The variables will be available in the _root of the main timeline.

Rui


OK, apparently, I don't need to add PARAMs and a/v pairs in the EMBED (just append it onto the swf filename like a POST to a php page), but what is the "_root of the main timeline"?

Reply With Quote
  #3  
Old August 4th, 2003, 05:18 PM
blatant's Avatar
blatant blatant is offline
World Domination
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: San Diego
Posts: 126 blatant User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 17 sec
Reputation Power: 6
Send a message via AIM to blatant
_root is the base layer of the movie. If you have a variable (ie var1) in a movieclip called mc, you access it like this:
_root.mc.var1

if var1 was at the "_root of the main timeline" you access it with:
_root.var1

This really is almost the same thing as the other post, just the variables are not coming from a seperate file, but in the object tag, so you don't have to use a loadvars() call.

Last edited by blatant : August 4th, 2003 at 05:21 PM.

Reply With Quote
  #4  
Old August 4th, 2003, 09:20 PM
LANLord's Avatar
LANLord LANLord is offline
IT Dept Scapegoat
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 169 LANLord User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 54 m 43 sec
Reputation Power: 6
Thanks for your reply blatant. I'm sure that all makes a ton of sense, but to me, it contains no information. I'm paying attention, but I think I'm just new to this. It feels very much like the first time I was forced to program in vb <shudder>, where I did a lot of property setting, and not as much programming as I would have thought.

What if I don't have a movie clip? I just have a two frame fla file, where the first frame has a button to go to the second frame, and the second frame has a button to go to the first frame. I added another layer for a combobox and placed it on stage. Right there is where I'm stuck. I can dynamically generate anything I want in the html, but I don't know what to code where. I'm guessing I need to write an action script, but what does it look like, and what do I attach it to? Since the combobox is in another layer, not the main one, will I be able to load it?

Man, I have looked a bunch of tutorials, but I must be rockheaded or something, cuz it's just not making sense. I'm sure the light will click on and I'll have the whole thing figured out at once, but until then, I'm hosed.

Reply With Quote
  #5  
Old August 6th, 2003, 07:50 PM
blatant's Avatar
blatant blatant is offline
World Domination
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: San Diego
Posts: 126 blatant User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 17 sec
Reputation Power: 6
Send a message via AIM to blatant
Think of everything as objects. If you place anobject on the stage you access it in actionscript using its name, and you access its properies and methods using dot notation: object.property or object.method()

For example, if you place a movieclip on the stage called "mc", you can set it to be invisible by writing: mc.visible=false; in actionscript.

Similarly, the whole flash movie is an object that is always called "_root". You can also access that same movieclip called "mc" by writing: _root.mc.visible=false; In fact, when your actionscript is inside a movieclip, it is necessary to use _root to tell the actionscript to look for the object in the main movie instead of inside your movie clip.

In your case, "_root of the main timeline" just means the main movie. Action script does not dependant on layers, so you can access your variables/objects from any layer.

For an example of how to populate combo boxes, look up the addItem() method in the help, or look at the .fla I posted in "How to populate a combo box from ASP"

I hope that helps clear things up.

Reply With Quote
  #6  
Old August 7th, 2003, 11:44 AM
LANLord's Avatar
LANLord LANLord is offline
IT Dept Scapegoat
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 169 LANLord User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 54 m 43 sec
Reputation Power: 6
So then, if I understand you correctly, I could additems to a cmbobox named cboSections in a movie clip like this:
Code:
_root.cboSections.addItem("HelpDesk", 2);
_root.cboSections.addItem("Projects", 4);

But where does the action script go? Should I use #initclip and #endinitclip?

Reply With Quote
  #7  
Old August 7th, 2003, 11:45 AM
LANLord's Avatar
LANLord LANLord is offline
IT Dept Scapegoat
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 169 LANLord User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 54 m 43 sec
Reputation Power: 6
One more thing... I added the combobox after I had set up a few frames. When I set the instance name, it does not appear to propigate to other frames. How do I handle this?

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Loading Data into Combo Box from HTML


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway