Flash Connecting to a database

hi,
I have a movieclip with instance name dummy.This movieclip has a button myMovie with instance name myMovie.

what i have is something like this for the movieclip:
onClipEvent (enterFrame) {
myColor = new Color(dummy.myMovie);
myColor.setRGB(0x993366);
}
& for button:
on (release) {
myColor = new Color(myMovie);
myColor.setRGB(0x336699);
}
This script works for button but does’nt work with the movieclip on load.
What i want is the functionality for button to be applicable for the movieclip on load.
I want the color of the movieclip to change to the hexRGB value set(0x336699) on load of the movie.

Can you please tell me what’s the problem with my script?

U can have a look at my .fla file even from the following location:
http://www.geocities.com/shuklahetal/script.fla
http://www.geocities.com/shuklahetal/script.swf

Thanks & Regards
Hetal

Howdy…

Pathing problem it is… You are not calling the path correctly…

onClipEvent (enterFrame) {
	myColor = new Color(_level0.dummy.myMovie);
	myColor.setRGB(0x993366);
}

hi,
Now if want to modify the script such as:

onClipEvent(load){
myColor = new Color(myMovie);
myColor.setRGB(0x993366);
}

to be

onClipEvent(load){
myColor = new Color(myMovie);
myColor.setRGB(color);
}

& this color is said to be a variable which comes from an asp file say something like this:

<%

Response.write "color=0x993366"   

%>

When i do this, the variable color is not loaded from asp file
The entire purpose is to make the movie dynamic at runtime.

Please assist regarding the same.

Thanks & Regards
Hetal

First of all… ‘color’ is reserved word in Flash so it should not be used as a variable name… Let’s just call it ‘theColor’ instead… and assuming that you are getting the new color value from the ASP page and saves the value to the variable theColor…

onClipEvent(load)
{
   trace("theColor = " + theColor);
   myColor = new Color(myMovie);
   myColor.setRGB(theColor);
}

What do you see with this trace() function??? Do you get to see the color value correctly??? It could be the pathing problem…

Hi,
I tried the trace mentioned by u. It says something like this in the output window:
theColor =

I think it’s unable to load the variable "theColor "

Can you please check the same at your end & let me know what needs to be done.
I’m sending you the zip file.

Have i loaded variables correctly in the first frame of my movie?

Awaiting a reply.
Thanks & Regards
Hetal

The main thing is that you don’t know if the ASP string has been fully loaded or not with loadVariablesNum() function… So, I have used LoadVars() object to do that… And since the variable, theColor, doesn’t get to get loaded in the first place, onClipEvent (load) won’t work… so I had to use onClipEvent (enterFrame) to apply the new color… (You need to change the paht for the ASP file so that it will call yours properly…)

hi,
thanks for the reply. But i want to see the script.fla which u’ve posted as an attachment but it’s not opening saying “Unexpected File format”.

Can u please help?
Thanks & regards
Hetal

Um… Are you using F5??? :frowning:

hi,
I am using Flash MX but it’s giving me the same error in either of the versions.

Awaiting a reply.

Thanks & Regards
Hetal

Hm… I don’t know why you are not able to open the file… I have saved another file and posting it again… This better work cuz I am off to bed… It’s 6am here… :beam: Let me know if it worked for you or not…

hi,
thanks once again for the file but does the color change on run time.
Please let me know later.
Thanks & regards
hetal

I get to see the color changed about 1 second later… What do you mean???

hi,
thanks for the reply. I managed getting the color change on run time but still have a problem and that is of a mouseover toolltip which also has to appear dynamically.
Now that we’ve set a RGB value for the movieclip, even the button mouseover tooltip which is embedded within this movieclip picks the same RGB value set.
I just want the tooltip to have a differnt graphical base & the content of the tooltip can appear in the dynamic txt field which loads variables from the same asp file(getdetails.asp)

Is there a way to acheive this functionalty.
Please provide further assistance for the same.

Awaiting a reply from u.

Thanks & Regards
Hetal

Um… What tooltip are you talking about???

hi,
Basically i am looking for a mouseover descripiton to appear when somebody mouseovers the button which is embedded within the movieclip dummy as u must have seen in my .fla file.
The description of the tooltip should come dynamically as it will be a txt field with some variable name “XYZ” given which picks up from the asp file as we’ve done with “theColor” variable.

Awaiting a reply from u.

Thanks & Regards
Hetal

hi,
i want a tooltip kind of a mouseover to appear dynamically. I have tried to use attachmovie but does’nt seem to be working.

I have a movieclip with the instance name “dummy” on the first frame of my scene. The actionscript for the same is:

onClipEvent (enterFrame) {
loadVariables(“Getdetails.asp”, this, “POST”);
myColor = new Color(_root.dummy.myMovie);
myColor.setRGB(theColor);
}

This movieclip inturn has a button embedded with instance name myMovie.The actionscript for the same is:
on (release) {
getURL("#", “_self”, “POST”);
}
on (rollover) {
dummy.attachMovie(“att1”, “newname1”, 1);
}
Getdetails.asp looks something like this
<%

Response.write "theColor=0xFF0000"
Response.write "label=ItemA"

%>

My flash library has a movieclip MC_attach1 with linkage given as “att1” which is having the tootlip movieclip embedded within it.This should pick up the variable label from the asp file as mentioned above.

Can u please help me in acheiving this functionality.

Please find the zip file attached herewith.
I have two .fla files script1.fla & script2.fla.What i want is the kind of mouseover happening in script2.fla to be incorporated in script1.fla keeping all the code intact.

Thanks & Regards
Hetal

Here you go… Another pathing problem, I’ve found today…

Hi,
i downloaded the attachment script1.fla but am not able to get what r u trying to say.
Can u please rectify my script?

Thanks & Regards
Hetal

You just want to see that tooltip box opened, right???

I think I just fixed this line…

on (rollover) {
_root.dummy.attachMovie("att1", "newname1", 1);
}

hi,
thanks for the reply.
I rectified the script & the tooltip appears on mouseover but the description txt of the tooltip which needs to be picked up from the asp file does’nt seem to appear & also the color which was changing on runtime yesterday is now lost.
My asp file looks something like this:

<%

Response.write "theColor=0xFF0000"
Response.write "label=ItemA"

%>

& am attaching the script1.fla again.
Please check & revert back for the same.

Thanks & Regards
Hetal