# Flash Connecting to a database

**URL:** <https://forum.kirupa.com/t/flash-connecting-to-a-database/16026>\
**Category:** flash\
**Created:** [March 20, 2003, 9:12am UTC](https://forum.kirupa.com/t/flash-connecting-to-a-database/16026 "2003-03-20T09:12:34Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![hetal](https://avatars.discourse-cdn.com/v4/letter/h/54ee81/32.png) [@hetal](https://forum.kirupa.com/u/hetal)\
**Post date:** [March 20, 2003, 9:12am UTC](https://forum.kirupa.com/t/flash-connecting-to-a-database/16026/1 "2003-03-20T09:12:34Z")

</div>

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.fla)  
[http://www.geocities.com/shuklahetal/script.swf](http://www.geocities.com/shuklahetal/script.swf)

Thanks & Regards  
Hetal

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 20, 2003, 9:23am UTC](https://forum.kirupa.com/t/flash-connecting-to-a-database/16026/2 "2003-03-20T09:23:20Z")

</div>

Howdy…

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

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

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 20, 2003, 10:13am UTC](https://forum.kirupa.com/t/flash-connecting-to-a-database/16026/3 "2003-03-20T10:13:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 20, 2003, 10:17am UTC](https://forum.kirupa.com/t/flash-connecting-to-a-database/16026/4 "2003-03-20T10:17:33Z")

</div>

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…

```auto
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…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 20, 2003, 10:30am UTC](https://forum.kirupa.com/t/flash-connecting-to-a-database/16026/5 "2003-03-20T10:30:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 20, 2003, 10:43am UTC](https://forum.kirupa.com/t/flash-connecting-to-a-database/16026/6 "2003-03-20T10:43:51Z")

</div>

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…)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 20, 2003, 10:52am UTC](https://forum.kirupa.com/t/flash-connecting-to-a-database/16026/7 "2003-03-20T10:52:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 20, 2003, 10:54am UTC](https://forum.kirupa.com/t/flash-connecting-to-a-database/16026/8 "2003-03-20T10:54:19Z")

</div>

Um… Are you using F5??? ☹

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 20, 2003, 10:59am UTC](https://forum.kirupa.com/t/flash-connecting-to-a-database/16026/9 "2003-03-20T10:59:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 20, 2003, 11:02am UTC](https://forum.kirupa.com/t/flash-connecting-to-a-database/16026/10 "2003-03-20T11:02:38Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 20, 2003, 11:09am UTC](https://forum.kirupa.com/t/flash-connecting-to-a-database/16026/11 "2003-03-20T11:09:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 20, 2003, 11:11am UTC](https://forum.kirupa.com/t/flash-connecting-to-a-database/16026/12 "2003-03-20T11:11:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 20, 2003, 4:51pm UTC](https://forum.kirupa.com/t/flash-connecting-to-a-database/16026/13 "2003-03-20T16:51:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 20, 2003, 11:26pm UTC](https://forum.kirupa.com/t/flash-connecting-to-a-database/16026/14 "2003-03-20T23:26:35Z")

</div>

Um… What tooltip are you talking about???

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 21, 2003, 5:00am UTC](https://forum.kirupa.com/t/flash-connecting-to-a-database/16026/15 "2003-03-21T05:00:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 21, 2003, 5:46am UTC](https://forum.kirupa.com/t/flash-connecting-to-a-database/16026/16 "2003-03-21T05:46:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 21, 2003, 5:57am UTC](https://forum.kirupa.com/t/flash-connecting-to-a-database/16026/17 "2003-03-21T05:57:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 21, 2003, 6:01am UTC](https://forum.kirupa.com/t/flash-connecting-to-a-database/16026/18 "2003-03-21T06:01:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 21, 2003, 6:23am UTC](https://forum.kirupa.com/t/flash-connecting-to-a-database/16026/19 "2003-03-21T06:23:43Z")

</div>

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

I think I just fixed this line…

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

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 21, 2003, 6:40am UTC](https://forum.kirupa.com/t/flash-connecting-to-a-database/16026/20 "2003-03-21T06:40:52Z")

</div>

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

[Next page](https://forum.kirupa.com/t/flash-connecting-to-a-database/16026.md?page=2)
