Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Start movie and goto scene based on ASP variable?

Status
Not open for further replies.

Flashgordon

Technical User
Apr 5, 2001
52
GB
Hi all
We're trying to load a movie and go to a scene other than scene 1 based on a variable which has been passed into the file from a different ASP file. We're doing the loadvariable command and then using an IF command to decide where to go, but it seems to have no effect and plays scene 1. I'm not sure if the variable is loading properly, or if it's just being ignored. Can anyone help? I get the feeling from this and other forums that no Flash expert knows anything about ASP, and vice-versa!
 
I know some stuff about ASP, but really the ASP stuff is irrelevant, because Flash doesn't care where it gets the variables from; as long as it gets them!

The way I have done ASP stuff before is to call a script from Flash (in the load variables command) and then set the variables up in that; for example call your asp script 'load_variables.asp' and then set-up your variables in this (in standard html format).

As an example I've cut and pasted a bit of code below (sorry it looks so dodgy but asp doesn't format well in here!!!) - this should give you an idea.

If it's no good drop me a line (petitpal@yahoo.com) and I'll see what I can do.

=)

PetitPal.



<%if Rs.EOF or Rs.BOF then%>
&message=No+Record&firstname=&middleinitial=&lastname=&address1=&address2=&address3=&address4=&address5=&postcode=&telephone=
<%else%>
&message=&firstname=<%=Rs(&quot;Customer_FirstName&quot;)%>&middleinitial=<%=Rs(&quot;Customer_MiddleInitial&quot;)%>&lastname=<%=Rs(&quot;Customer_LastName&quot;)%>&address1=<%=Rs(&quot;Customer_Address1&quot;)%>&address2=<%=Rs(&quot;Customer_Address2&quot;)%>&address3=<%=Rs(&quot;Customer_Address3&quot;)%>&address4=<%=Rs(&quot;Customer_Address4&quot;)%>&address5=<%=Rs(&quot;Customer_Address5&quot;)%>&postcode=<%=Rs(&quot;Customer_Postcode&quot;)%>&telephone=<%=Rs(&quot;Customer_Telephone&quot;)%>
<%end if%>
 
Whenever you use the loadvariables command to achieve a 'goto' frame variable, you must create a 'controller' mc to check whether the variable has been loaded. Furthermore, it is also best to load an extra true/false variable along with the one your utilising as a target.

For example, you have a button which when pressed activates a lodavariables action to read from an ASP/PHP/whatever file. As well as activating the ASP file, it also activates an mc on the stage which has a basic 2 frame loop, which checks for the existence of a 'true/false' value from the ASP/PHP/whatever file. If it detects the existence of this variable, then it instructs the main-timeline/whatever to go to the frame passed from the ASP file, as well as instructing the conrol-loop mc to stop.

This isn't difficult to achieve and forms the basis of all Flash and ASP/PHP/whatever mail-forms, where the movie requires to know whether the message has been sent/recieved.

If you require a re-usable loadvariables command, all you do is make the first action when the button is pressed set the value of the 'check' variable to something 'bizarre' which it could never equal.

is this too confusing?

dave
dave@pinkzeppelin.com

^^^^^^^^^^^^^^^^^^^^^​
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top