# How to send Commands to Flash after it has been loaded once?

**URL:** <https://forum.kirupa.com/t/how-to-send-commands-to-flash-after-it-has-been-loaded-once/120449>\
**Category:** Uncategorized\
**Created:** [August 24, 2004, 12:44pm UTC](https://forum.kirupa.com/t/how-to-send-commands-to-flash-after-it-has-been-loaded-once/120449 "2004-08-24T12:44:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_4\_Cologne](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@Alex\_4\_Cologne](https://forum.kirupa.com/u/Alex_4_Cologne)\
**Post date:** [August 24, 2004, 12:44pm UTC](https://forum.kirupa.com/t/how-to-send-commands-to-flash-after-it-has-been-loaded-once/120449/1 "2004-08-24T12:44:38Z")

</div>

A Flash SWF can send a command to an HTML File with

```auto
getURL("javascript:function()")

```

or

```auto
fscommand("foo", "bar")

```

My Question:  
Can HTML send something to a Flash AFTER it has been loaded (by Javascript or something)? If so, how?

---

<div class="post-metadata">

**Author:** ![Mad\_Flasher](https://avatars.discourse-cdn.com/v4/letter/m/3e96dc/32.png) [@Mad\_Flasher](https://forum.kirupa.com/u/Mad_Flasher)\
**Post date:** [August 24, 2004, 5:07pm UTC](https://forum.kirupa.com/t/how-to-send-commands-to-flash-after-it-has-been-loaded-once/120449/2 "2004-08-24T17:07:14Z")

</div>

no, (or atleast not to my knowledge) the only way things can be changed once its loaded is by using actionscript

---

<div class="post-metadata">

**Author:** ![Alex\_4\_Cologne](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@Alex\_4\_Cologne](https://forum.kirupa.com/u/Alex_4_Cologne)\
**Post date:** [August 25, 2004, 8:51am UTC](https://forum.kirupa.com/t/how-to-send-commands-to-flash-after-it-has-been-loaded-once/120449/3 "2004-08-25T08:51:43Z")

</div>

ok, i know i can give parameters on load, but this wasn’t the question.

i cannot think of a solution too, but that’s why i ask the kirupa masters 🙂

---

<div class="post-metadata">

**Author:** ![Voetsjoeba](https://avatars.discourse-cdn.com/v4/letter/v/ac91a4/32.png) [@Voetsjoeba](https://forum.kirupa.com/u/Voetsjoeba)\
**Post date:** [August 25, 2004, 8:57am UTC](https://forum.kirupa.com/t/how-to-send-commands-to-flash-after-it-has-been-loaded-once/120449/4 "2004-08-25T08:57:54Z")

</div>

I think you can use javascript and setvariable.  
Check out this page, it might be of help:  
[http://www.mustardlab.com/developer/flash/jscommunication/](http://www.mustardlab.com/developer/flash/jscommunication/)

---

<div class="post-metadata">

**Author:** ![Jerryscript](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jerryscript/32/451_2.png) [@Jerryscript](https://forum.kirupa.com/u/Jerryscript)\
**Post date:** [August 25, 2004, 12:08pm UTC](https://forum.kirupa.com/t/how-to-send-commands-to-flash-after-it-has-been-loaded-once/120449/5 "2004-08-25T12:08:39Z")

</div>

So long as you name and ID your object and embed tags, you can use JavaScript to set a variable (and there are other JS methods as well).

I create a MovieClip, set it’s onEnterFrame to check the value of a variable, and then use JavaScript’s setVariable method to change the value. When the onEnterFrame finds the value of the variable changed, it calls the appropriate function to deal with the variable changes.

The main issue with this is cross-browser compatibility with the JavaScript methods.

---

<div class="post-metadata">

**Author:** ![newflavour](https://avatars.discourse-cdn.com/v4/letter/n/dbc845/32.png) [@newflavour](https://forum.kirupa.com/u/newflavour)\
**Post date:** [August 25, 2004, 10:59pm UTC](https://forum.kirupa.com/t/how-to-send-commands-to-flash-after-it-has-been-loaded-once/120449/6 "2004-08-25T22:59:26Z")

</div>

have a look at the source code on:  
[http://www.qldcricket.com.au/](http://www.qldcricket.com.au/)

It shows how I’ve used an onload command to change the text within the flash movie. It’s a basic javascript push, so yes, it can be done and you can do quite a lot with it.
