# How to read different values from different domain/website/database?

**URL:** <https://forum.kirupa.com/t/how-to-read-different-values-from-different-domain-website-database/42201>\
**Category:** Uncategorized\
**Created:** [February 6, 2004, 10:39am UTC](https://forum.kirupa.com/t/how-to-read-different-values-from-different-domain-website-database/42201 "2004-02-06T10:39:29Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![minuet](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@minuet](https://forum.kirupa.com/u/minuet)\
**Post date:** [February 6, 2004, 10:39am UTC](https://forum.kirupa.com/t/how-to-read-different-values-from-different-domain-website-database/42201/1 "2004-02-06T10:39:29Z")

</div>

Can any expert help me with this…?

I have a flash file that reads variable from a text files(eg. myhobby.txt). That is easy.

&myHobbies=swimming

Now here is the complicated/difficult part

Using the same and only flash file how do I read from different sever/database?

e.g.

there is 3 website sharing the same and only flash files.  
-if website ‘A’ load the flash files it will load ‘A’ hobbies  
-if website ‘B’ load the flash files it will load ‘B’ hobbies  
-if website ‘C’ load the flash files it will load ‘C’ hobbies

that means there is 3 myhobby.txt files altogether in 3 different sever/database.

This is very new to me. Please help.

Thanks!

---

<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:** [February 6, 2004, 11:21am UTC](https://forum.kirupa.com/t/how-to-read-different-values-from-different-domain-website-database/42201/2 "2004-02-06T11:21:17Z")

</div>

just change the myHobbies to myHobbiesA, myHobbiesB and myHobbiesC… Would that help?

EDIT: Sorry, now I got what you mean. You can try this:

```auto
myLoadVars = new LoadVars();
myLoadVars.load("http://www.myserver.com/myHobbies.txt");

```

Just change the [myserver.com](http://myserver.com) to three website addresses you use. Would that help?

---

<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:** [February 6, 2004, 11:40am UTC](https://forum.kirupa.com/t/how-to-read-different-values-from-different-domain-website-database/42201/3 "2004-02-06T11:40:30Z")

</div>

try using a variable in the embed:

\<embed src=“myMovie.swf?server=1”…for your 1st server  
\<embed src=“myMovie.swf?server=2”…for your 2nd server  
\<embed src=“myMovie.swf?server=3”…for your 3rd server

and in your movie use an if statement to declare which txt file to load:

if (server == 1) {  
this.loadVariables(“myhobby1.txt”);  
} else if (server == 2) {  
this.loadVariables(“myhobby2.txt”);  
} else if (server == 3) {  
this.loadVariables(“myhobby3.txt”);  
}

---

<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:** [February 6, 2004, 11:41am UTC](https://forum.kirupa.com/t/how-to-read-different-values-from-different-domain-website-database/42201/4 "2004-02-06T11:41:37Z")

</div>

I’m not an expert, but I used something similar in a project of mine and it proved to be very useful.

I hope it helps your issue too.

Good luck.

🙂

---

<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:** [February 6, 2004, 2:19pm UTC](https://forum.kirupa.com/t/how-to-read-different-values-from-different-domain-website-database/42201/5 "2004-02-06T14:19:18Z")

</div>

Thanks for the reply.

I know what you mean but there is 3 domain that call up the flash, and the indiviuals txt files are stored in each of these domain, so the questions is:

How how the flash know which domain call it up, so that it will load the collect text file.

Example,  
Domain A loads the flash file, then the flash file will know its domain A, so it will .[COLOR=red]load the txt file from domain A[/COLOR] that is meant for Domain A.

forgot to said thanks…

Thanks.

---

<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:** [February 6, 2004, 2:21pm UTC](https://forum.kirupa.com/t/how-to-read-different-values-from-different-domain-website-database/42201/6 "2004-02-06T14:21:54Z")

</div>

Thanks for the reply… I will try that out.

Thanks

---

<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:** [February 6, 2004, 2:51pm UTC](https://forum.kirupa.com/t/how-to-read-different-values-from-different-domain-website-database/42201/7 "2004-02-06T14:51:42Z")

</div>

I merged both threads as they were identical.  
Please dont crosspost minuet.

---

<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:** [February 9, 2004, 9:10am UTC](https://forum.kirupa.com/t/how-to-read-different-values-from-different-domain-website-database/42201/8 "2004-02-09T09:10:30Z")

</div>

Anyone who read this question can also help me with this.

Hi Amaze and all,

I have tried you method, I know what you meant…  
But it is not working.

Below are the codes I copied from my HTML, can you point out what’s wrong?

\<object classid=“clsid:D27CDB6E-AE6D-11cf-96B8-444553540000” codebase=“[http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0](http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0)” width=“150” height=“453”\>  
\<param name=“movie” value=“myHobby.swf”\>  
\<param name=“quality” value=“high”\>  
\<embed src=“myHobby.swf?domain=1” quality=“high” pluginspage=“[http://www.macromedia.com/go/getflashplayer](http://www.macromedia.com/go/getflashplayer)” type=“application/x-shockwave-flash” width=“150” height=“453”\>\</embed\>\</object\>

From my Flash part,  
if (domain == 1)  
{  
this.loadVariables(“myHobby\_A.txt”, \_root);  
}  
else if (domain = “BBB”)  
{  
this.loadVariables(“myHobby\_B.txt”, \_root);  
}  
else if (domain = “CCC”)  
{  
this.loadVariables(“myHobby\_C.txt”, \_root);  
}

That’s all for the codes part.

Here are some questions.

-Where the flash loads the txt file, does it takes the (HTML page) or (the flash itself) as references to find the txt file.

-There is ‘param’ and ‘embed’ tag which one should I insert the &domain=1.

-when inserting the domain, should I use “&”(and) or “?”(question mark).  
e.g  
myHobby.swf?domain=1  
or  
myHobby.swf&domain=1

Sorrie about my long winded question but I am really stuck with this.

Thanks

---

<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:** [February 9, 2004, 9:11am UTC](https://forum.kirupa.com/t/how-to-read-different-values-from-different-domain-website-database/42201/9 "2004-02-09T09:11:58Z")

</div>

Forgot to mention, the HTML codes are generated by dreamweaver MX.

---

<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:** [February 9, 2004, 10:00am UTC](https://forum.kirupa.com/t/how-to-read-different-values-from-different-domain-website-database/42201/10 "2004-02-09T10:00:11Z")

</div>

In this part of your html code:

\<param name=“movie” value=“myHobby.swf”\>

add the parameter…

\<param name=“movie” value=“myHobby.swf?domain=1”\>

Also use the variable domain as root:  
\_root.domain

---

<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:** [February 9, 2004, 10:04am UTC](https://forum.kirupa.com/t/how-to-read-different-values-from-different-domain-website-database/42201/11 "2004-02-09T10:04:50Z")

</div>

you use the question mark to start giving the variables and the “&” symbol to separate them.

As I told you above, you must insert “?domain=1” to both places.

Flash loads the txt file from where the page is and not from where the swf is.  
As long as you load the swf in your page it’s part of it.  
So if your txt is in another folder from the page, you have to target it.

Good luck m8.

---

<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:** [February 9, 2004, 10:31am UTC](https://forum.kirupa.com/t/how-to-read-different-values-from-different-domain-website-database/42201/12 "2004-02-09T10:31:54Z")

</div>

Cool! It works. Thanks a lot lot lot.

Some bits and pieces.

\<param name=“movie” value=“myHobby.swf?domain=1”\>  
\<embed src=“myHobby.swf?domain=1” …

I use domain=1 to compare which is number(integer).It works!

but then

\<param name=“movie” value=“myHobby.swf?domain=alvin”\>  
\<embed src=“myHobby.swf?domain=alvin” …

in flash codes,

if( domain == “alvin”){  
…  
}

when I used string to compare it won’t work.

Any Idea where it is wrong.

Thanks.

---

<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:** [February 9, 2004, 10:36am UTC](https://forum.kirupa.com/t/how-to-read-different-values-from-different-domain-website-database/42201/13 "2004-02-09T10:36:24Z")

</div>

Forget about the question above, I have sort it out.  
It was my careless.

Thanks alot!

---

<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:** [February 9, 2004, 3:17pm UTC](https://forum.kirupa.com/t/how-to-read-different-values-from-different-domain-website-database/42201/14 "2004-02-09T15:17:52Z")

</div>

Anytime.

Glad I could help.

---

<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:** [February 10, 2004, 2:18am UTC](https://forum.kirupa.com/t/how-to-read-different-values-from-different-domain-website-database/42201/15 "2004-02-10T02:18:53Z")

</div>

Some more questions about passing values.  
Can I pass in value in HTML like the example below?

\<param name=“Hobby” value=“swimming”\>  
\<embed src=“myHobby.swf”\>

instead of

\<embed src=“myHobby.swf?Hobby=swimming”\>

If can, can point out my mistake, because I tried and It wont work.

Thanks.

---

<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:** [February 10, 2004, 8:38am UTC](https://forum.kirupa.com/t/how-to-read-different-values-from-different-domain-website-database/42201/16 "2004-02-10T08:38:39Z")

</div>

You can’t pass variables this way, as far as I know.

If you want to use strings in your variables use this in the fla:

if( Hobby eq “swimming”){  
…  
}

You can pass multiple variables by using the “&” symbol.

\<embed src=“myHobby.swf?Hobby=swimming&petName=Boogie&favoriteColor=blue”\>

---

<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:** [February 10, 2004, 10:24am UTC](https://forum.kirupa.com/t/how-to-read-different-values-from-different-domain-website-database/42201/17 "2004-02-10T10:24:03Z")

</div>

Thanks!. That’s all I need to verify.
