|
-
I wrote a asp file and saved it on the server, the database on the server will populate that asp file, given the Varaibles from the asp file, Flash 5 shows them (dynamic text fields).
This works well, but what I need help on, is that the Flash 5 movie has 13 Instances sitting on _level0 and they each have a Instance name ( a, b , c , d etc..)
How can I have that asp file dynamicly turn on and off those instances without using a button.
I creat a button and tell it to fetch the asp that works but I really need this to be when the page loads vs a button clicked.
Any help would be greatly accepted.
Thanks
-
Well, just put the actionscript of the button in the first form, that should do it...
-
By the way this is not a submit form, if it were - there are 100 tutorials on how to create a form and use .asp with it.
What I am doing is simply passing Vars from .asp to Flash in terms of dynamix text boxes with var names, But beside each dynamic Name I need the asp to also turn on/off a movie if that var name is = to true or false.
I have tried alot differnt coding methods and vars.
//the .asp looks like this:
<%@ Language=VBScript %>
<%
Option Explicit
Response.Write "Cars=true&"
Response.Write "Boats=false&"
Response.Write "Beer=true&"
%>
//--------------end asp file
//On frame (1)
loadVariablesNum ("http://xxx.xxxxx.xxx/data.asp", 0);
//hard load the .asp file this way so you dont have to
//upload to server to see the .asp file work
//On frame(2)
if (frame, 1, loaded) {
gotoAndPlay ("Scene 1", 3);
}else{
gotoAndPlay ("scene 1", 1);
}
//I try to create a loop, you can do this
//by using a button as well
//( but I can not use a button)
//On frame(3)
eval(Cars)
//this will check the .asp file to see if the
//dynamic text box variable is = to true or false
{
if(true);
setProperty ("XXX", _visible, true);
if(false);
setProperty ("XXX", _visible, false);
//XXX is a "instance name" of a movie on _level0
}
Thanks for your time ,
I guess I am looking for a Onload somthing : if when the page loads it will call the asp and read it.
-
bit nervous about answering a question in the scripting&backend group but hey 
and xxx.xxxxx.xxx must be a porn site, right 
Anyway, is this the actual action script code you are using in your fla file or just a paraphrased version? Not sure all those statements will really work...
What you are doing seems to be correct - load the variables, and set the visibility of your movie clips. Not sure where you are using buttons here?
If you are having problems seeing the imported variable values, try 'loadVariables("my.asp",_root)' and then the variables will be accessible by _root.car etc.
If the problem is with waiting until the variables have been fully loaded, do this:
- create a movie clip instance called (for example) varLoader
- load the variables using loadVariables("my.asp",varLoader)
- put a stop(); action after the loadVariables
then in the movie clip action of the varLoader movie clip instance, you can use an onClipEvent(data) to trigger when the data has fully loaded and use this to continue running your flash file or hiding the other stuff or whatever.
Is this any help? Not sure I understand the question correctly but maybe you can clarify...
see ya - n.
-
Now I see it. When you check in the loop, the loop doesn't wait till the data to come back from the server. The frame the frame itself has been loaded it moves on, meaning the data come yet.
The second frame check should be diferent. You should check if a variable called 'came' is true or false, when true go to the other thing, if not go backward one frame wich plays straight into the check one. So the moment the data came back you can check if to show your movies.
Now you will have to use 4 frames, 1 first for getting from .asp second and third for looping until the data got, and fourth for analaysing the data.
Hope this helps
-
Both of you are very close 
and no its not a porn site, I just figured I would replace my actual URL with xxx
And yes the problem lies where it moves on before loading the asp file, If I use a Button to call the asp file it works with no problems, but I can not have our users clicking a button, it needs to be when they load the page it calls that asp file and alows them to see the dynamic data.
Thanks for the support, and I will try these excellent feedbacks
-
Hi wellhead,
are you using Flash 4?
In Flash5 your coding should look like
Code:
if(Cars == "true")
_root.Cars._visible = 1;
else
_root.Cars._visible = 0;
(assuming Cars is the name of your MC as well)
Musicman
-
Thanks Musicman
Yes I am using Flash 5, and I do like your code.
I was using
if(cars == true)
}
_level0.InstanceName,_visable, 1);
}else{
_level0.InstanceName,_visable, 0);
}
^^Somthing to that effect^^ true/false or 1/0
I was also trying
if(cars ne " ")
setProperty ("MC", _visible, true);
if(false);
setProperty ("MC", _visible, false);
and I guess it worked but I have tryed so manny differnt idea's I just can not keep track :\
So I will try the loadvars into a Movie on frame (1)
and then I will try your method of coding for the MC's.
Thanks for all the imput guys, I will certainly share this when it works 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|