Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Supporting Technologies > Server-Side Scripting

Reply
 
Thread Tools Rate Thread Display Modes
Old 03-08-2001, 04:29 PM   #1
salex2
Registered User
 
Join Date: Mar 2001
Posts: 5
Default

In a nutshell:

I have a Database of U.S. locations with various details associated to each one; an ASP page for interfacing with the Database and sending variables back to Flash; and the Flash movie.

Process: The user clicks a particular button in the movie, which sends the ASP page parameters to pull certain data from database. The results are formatted into variables and sent to the movie.

Currently I send all location names (passed as locNames) to one large text field, one per line. However, I need to be able to click on a location name and replace the locations text field with the details for the selected location (passed as locDetails).

What is the best way to accomplish this?

Thank you in advance.
~A~
salex2 is offline   Reply With Quote
Old 03-09-2001, 03:16 AM   #2
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

I would have a text field (with an embede font) in an MC on the main stage. Then my buttons would call up the relevant data from the database and set the variable in the text field to the value of that data, then I'd set the visibility of that text filed to true.

Then I'd make each of the locations a button inside an MC and make their MC name the equivalent location's database name. Then you could hva ecode a bit like this on each button:

on (release) {
loadVariablesNum ("page.asp?location=" + _name, 0);
}

So if I clicked the MC called 'australia' it would load
page.asp?location=australia
and page.asp formats the data and passes it back.

Cheers

Jesse
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder
Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Old 03-09-2001, 03:45 AM   #3
salex2
Registered User
 
Join Date: Mar 2001
Posts: 5
Default

Thanks for the tips - the next step is...

Now that I have location buttons on stage, they need to be clickable so that when selected, the details for that location fill a text box (also passed via ASP when state is clicked initially).

How do I attach a dynamic link to the location textfield button??

Again - THANKS!
~A~
salex2 is offline   Reply With Quote
Old 03-09-2001, 06:20 AM   #4
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

That's why I said to label the state movie clips by name. Then if you have a state clip with an instance name 'Idaho' (I don't know anything about US geogrphy... maybe that aint a state, this code:

on (release) {
loadVariablesNum ("page.asp?location=" + _name, 0);
}

on a button within that 'idaho' clip will result in this call:
page.asp?location=idaho
See the '_name' element takes the instance name of the clip your button is in.

Cheers

Jesse
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder
Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Old 03-09-2001, 09:15 PM   #5
salex2
Registered User
 
Join Date: Mar 2001
Posts: 5
Default

Okay - I am following. The only catch is that there are multiple locations, the number of which is dynamic, in each state.

When the User clicks a state (Idaho, for example), the movie moves to the Locations frame and the list of location names are all that appear, in their own textboxes labelled "Location1", "Location 2", etc (I am using a preset number of locations - 6, don't know how to create the text fields on the fly, in position yet...can u help on that?). The next step is to have each location be clickable, as a button, and when the user clicks that location, the movie goes to a "details" frame with that locations details inserted into a textfield named "details"...or something.

I can't figure out the way to dynamically set the "hyperlink" for each of the Location buttons...what code do I need to pass each textfield-button to make it populate the "details" item in the details frame?

Jesse - you have been a great help. I apologize if some of this is rudimentary...I'm doing my best.

Thanks in advance.
~A~
salex2 is offline   Reply With Quote
Old 03-10-2001, 04:40 AM   #6
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

Umm OK I'm assuming this is laid out like a map and maybe you have red dots in each state to signify the locations that can be clicked or something... what you're going to need to do is soemthing like this.

Each state is an MC.
Each red dot is a button inside and MC and the MC's name is the name of the location.

The code on each red dot button should be that code I mentioned before:

on (release) {
_root.loadVariablesNum ("page.asp?location=" + _name, 0);
}

Each red dot button could also have a text field in it which shows the variable 'locatioName' or something, and you could have this code int he first frame of the MC.

this.locationName = _name;

This will make it such that each red button has a txt field showing it's name, and also has a link which, when clicked will oad up the appropriate data...

Cheers

Jesse
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder
Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Reply


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tree component & tracking in database flashpipe Components 1 08-08-2006 01:55 PM
Database Solution for Flash... Calling Beta Testers INM Projectors and CDs 3 10-25-2005 07:02 PM
Pulling Strings from a Database Xman51 ActionScript 2.0 2 06-15-2005 03:23 PM
Passing actionscript to access database via asp cannon303 ActionScript 2.0 19 03-28-2005 10:39 PM
getting all listed items from a list box.. toytwukstudios Components 0 01-30-2004 01:24 AM


All times are GMT. The time now is 12:00 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.