# Html to talk to flash?

**URL:** <https://forum.kirupa.com/t/html-to-talk-to-flash/59250>\
**Category:** Uncategorized\
**Created:** [July 29, 2004, 4:49pm UTC](https://forum.kirupa.com/t/html-to-talk-to-flash/59250 "2004-07-29T16:49:49Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![senator](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@senator](https://forum.kirupa.com/u/senator)\
**Post date:** [July 29, 2004, 4:49pm UTC](https://forum.kirupa.com/t/html-to-talk-to-flash/59250/1 "2004-07-29T16:49:49Z")

</div>

hey i was wondering if anyone new how to make html talk to flash? for instance, can a html link link to a page and then also send an action to flash? just curious. thanks to all in advance.

-senator

---

<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:** [July 29, 2004, 4:53pm UTC](https://forum.kirupa.com/t/html-to-talk-to-flash/59250/2 "2004-07-29T16:53:53Z")

</div>

html by itself can usually not talk to flash, you need some type of language between, because html doesn’t have functions and anything that programming needs, it’s more a styling language if I can say so (kinda a stretch)… but you can send variables to flash by putting them in the url they’re called for, such as .swf?id=32&username=senator and you can easily pass variables that way 😉

---

<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:** [July 29, 2004, 4:54pm UTC](https://forum.kirupa.com/t/html-to-talk-to-flash/59250/3 "2004-07-29T16:54:10Z")

</div>

You could use JavaScript. You should find something useful here:  
[http://www.macromedia.com/cfusion/search/index.cfm?loc=en\_us&term=javascript+flash+communication&area=](http://www.macromedia.com/cfusion/search/index.cfm?loc=en_us&term=javascript+flash+communication&area=)

---

<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:** [July 29, 2004, 5:14pm UTC](https://forum.kirupa.com/t/html-to-talk-to-flash/59250/4 "2004-07-29T17:14:02Z")

</div>

are you sure you can pass variables to an swf like that? How do you access them?

---

<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:** [July 29, 2004, 5:20pm UTC](https://forum.kirupa.com/t/html-to-talk-to-flash/59250/5 "2004-07-29T17:20:01Z")

</div>

yeah, they are automatically available in flash… looky: [http://nokrev.no-ip.com/bombingpixels/url\_function.swf?id=30](http://nokrev.no-ip.com/bombingpixels/url_function.swf?id=30) , or change it to fla to see the fla 😉

---

<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:** [July 29, 2004, 5:28pm UTC](https://forum.kirupa.com/t/html-to-talk-to-flash/59250/6 "2004-07-29T17:28:22Z")

</div>

lol hey that’s cool, very useful… Can’t believe I missed that lol…

I dont have flash at work, how do you access the variables? 😛

---

<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:** [July 29, 2004, 5:29pm UTC](https://forum.kirupa.com/t/html-to-talk-to-flash/59250/7 "2004-07-29T17:29:09Z")

</div>

they’re automatically available, the only line of code is: test.text=id;

---

<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:** [July 29, 2004, 5:37pm UTC](https://forum.kirupa.com/t/html-to-talk-to-flash/59250/8 "2004-07-29T17:37:16Z")

</div>

awesome

---

<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:** [July 30, 2004, 5:43pm UTC](https://forum.kirupa.com/t/html-to-talk-to-flash/59250/9 "2004-07-30T17:43:40Z")

</div>

Greetings and/or salutations!

I have a Flash movie with 4 sections in it. The first time you view the movie it plays through the 4 sections in order. From each of these sections you can click a button which loads a new HTML page. What I’d like to do is create a back button on these HTML pages that goes back to the relevant section of the Flash movie that the user clicked on.

I have used the code suggested above and this successfully passes the variables back into the Flash movie (thankyou!) but what I can’t seem to do is figure out how to use these variables to go to different areas of the main timeline. I must point out here that I am just learning ActionScript and all of my efforts and Googling and forum reading has turned up nothing.

I would really appreciate any help anyone might be able to give me…

Thanks,  
Emme

---

<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:** [July 30, 2004, 5:46pm UTC](https://forum.kirupa.com/t/html-to-talk-to-flash/59250/10 "2004-07-30T17:46:09Z")

</div>

you could have the button go to the page, and since it’s a different page for each button, you could then tell the back button to refer in the html to the swf with a certain variable with the correct frame number, then you could just use a gotoandplay to send it to that spot 😉

---

<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:** [July 30, 2004, 6:02pm UTC](https://forum.kirupa.com/t/html-to-talk-to-flash/59250/11 "2004-07-30T18:02:36Z")

</div>

Thanks so much for replying to my post! I had been trying to get the variables to point to different labels using 4 different URLS:

pets.swf?position="cows"  
pets.swf?position="sheep"  
pets.swf?position="geese"  
pets.swf?position=“chickens”

And some ActionScript in the first frame:

barnyard.text = position;  
if (position=cows) {  
gotoAndPlay(“cows01”);  
}  
if (position=sheep) {  
gotoAndPlay(“sheep01”);  
}  
if (position=geese) {  
gotoAndPlay(“geese01”);  
}  
if (position=chickens) {  
gotoAndPlay(“chickens01”);  
}

This doesn’t work but I can’t seem to find out how to fix it. Do you know why the if statements don’t work? Should I even be using if statements? I’ve been trying to figure this out for over 7 hours!

About to go crawl into a cave and never come out again,  
Emme

---

<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:** [July 30, 2004, 6:06pm UTC](https://forum.kirupa.com/t/html-to-talk-to-flash/59250/12 "2004-07-30T18:06:50Z")

</div>

I wouldn’t say the if statement’s best, but it’ll work just fine, try using == and don’t use quotes in the url, just have it be position=chickens or whatever 😉

---

<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:** [July 30, 2004, 6:31pm UTC](https://forum.kirupa.com/t/html-to-talk-to-flash/59250/13 "2004-07-30T18:31:07Z")

</div>

Thanks very much for your suggestions! I’ve done what you recommended but the movie still won’t go to the correct positions based on the variables.

Do you think there’s a better way to code this? You mentioned going to a frame number (as opposed to a frame label). What would the URL look like in this instance? Would it be:

pets.swf?position=15

Once I got into Flash, how would I tell it that a variable of 15 means go to frame number 15?

Packing a rucksack,  
Emme

---

<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:** [July 30, 2004, 6:39pm UTC](https://forum.kirupa.com/t/html-to-talk-to-flash/59250/14 "2004-07-30T18:39:36Z")

</div>

it’s easy enough to use labels, so that works, but try putting quotes in your if statements too

---

<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:** [July 30, 2004, 9:37pm UTC](https://forum.kirupa.com/t/html-to-talk-to-flash/59250/15 "2004-07-30T21:37:12Z")

</div>

Brilliant! That did the trick!

Thanks very much for your assistance…

'Tis much appreciated!

Unpacking her knapsack now,  
Emme

:kir:

---

<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:** [July 30, 2004, 11:17pm UTC](https://forum.kirupa.com/t/html-to-talk-to-flash/59250/16 "2004-07-30T23:17:48Z")

</div>

:thumb:

glad I could help
