# Linking Flash and HTML

**URL:** <https://forum.kirupa.com/t/linking-flash-and-html/19642>\
**Category:** flash\
**Created:** [April 30, 2003, 4:22am UTC](https://forum.kirupa.com/t/linking-flash-and-html/19642 "2003-04-30T04:22:20Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![RussianBeer](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/russianbeer/32/152_2.png) [@RussianBeer](https://forum.kirupa.com/u/RussianBeer)\
**Post date:** [April 30, 2003, 4:22am UTC](https://forum.kirupa.com/t/linking-flash-and-html/19642/1 "2003-04-30T04:22:20Z")

</div>

I have a movie, with a swift 3d element and flash, after playing the movie, I would like in its place load a regular HTML page.  
I dont want to load a new page, is it possible to do without loading to a new page??

---

<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:** [April 30, 2003, 5:44am UTC](https://forum.kirupa.com/t/linking-flash-and-html/19642/2 "2003-04-30T05:44:07Z")

</div>

How about if you use layers and JavaScript. You could probably place the Flash file on a layer in your HTML dicument and then find a Javascript that makes that layer disappear after a certain amount of time. I don’t have an actual script for you but it’s an idea…

---

<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:** [April 30, 2003, 6:22am UTC](https://forum.kirupa.com/t/linking-flash-and-html/19642/3 "2003-04-30T06:22:07Z")

</div>

good idea! anyone know?

---

<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:** [April 30, 2003, 6:32am UTC](https://forum.kirupa.com/t/linking-flash-and-html/19642/4 "2003-04-30T06:32:33Z")

</div>

not sure why it would load a new window without you telling it to  
with \_blank, but try this.

put this on the last keyframe of your movie, and it will load an  
html page in place of the existing one:

```php
getURL("page.html", "_self");

```

---

<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:** [April 30, 2003, 6:35am UTC](https://forum.kirupa.com/t/linking-flash-and-html/19642/5 "2003-04-30T06:35:05Z")

</div>

That wont work UNFLUX,  
Because my animation is already on that page… its half HTML half flash, and I want the flash side, after the animation is done, to disapear and leave only the HTML, and HTML underneath it.

---

<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:** [April 30, 2003, 6:38am UTC](https://forum.kirupa.com/t/linking-flash-and-html/19642/6 "2003-04-30T06:38:38Z")

</div>

ok. you need to have your page set in frames then. otherwise  
you can’t do it without loading an entire new page.

---

<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:** [April 30, 2003, 6:40am UTC](https://forum.kirupa.com/t/linking-flash-and-html/19642/7 "2003-04-30T06:40:01Z")

</div>

But whatabout that idea that lucidsurf got, the JAVA scripting?

---

<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:** [April 30, 2003, 6:42am UTC](https://forum.kirupa.com/t/linking-flash-and-html/19642/8 "2003-04-30T06:42:30Z")

</div>

i’m pretty sure you can’t run an external javascript to unload a flash movie, any of it’s levels, or layers, or anything to with flash.

besides, html doesn’t have layers. the easiest solution, IMO, is  
frames in this case.

---

<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:** [April 30, 2003, 6:43am UTC](https://forum.kirupa.com/t/linking-flash-and-html/19642/9 "2003-04-30T06:43:26Z")

</div>

hmm… I am pretty sure HTML does have layers… I use all the time…

---

<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:** [April 30, 2003, 6:43am UTC](https://forum.kirupa.com/t/linking-flash-and-html/19642/10 "2003-04-30T06:43:38Z")

</div>

you can call to a javascript FROM flash, but no back into it, is what  
I was trying to say. 🙂

---

<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:** [April 30, 2003, 6:44am UTC](https://forum.kirupa.com/t/linking-flash-and-html/19642/11 "2003-04-30T06:44:03Z")

</div>

ohh ok thx

---

<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:** [April 30, 2003, 6:45am UTC](https://forum.kirupa.com/t/linking-flash-and-html/19642/12 "2003-04-30T06:45:07Z")

</div>

ok , well if you get it to work that way, I’ll have learned something  
new about design. I hope you’re right.

Oh well, I tried. :whistle:

---

<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:** [April 30, 2003, 6:52am UTC](https://forum.kirupa.com/t/linking-flash-and-html/19642/13 "2003-04-30T06:52:13Z")

</div>

Iframes will work, or use DHTML layers, and call them either visible or invisible…

Rev ![](http://www.aulman.com/rev.gif)

---

<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:** [April 30, 2003, 6:53am UTC](https://forum.kirupa.com/t/linking-flash-and-html/19642/14 "2003-04-30T06:53:53Z")

</div>

not sure why frames isn’t an option here.

---

<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:** [April 30, 2003, 6:54am UTC](https://forum.kirupa.com/t/linking-flash-and-html/19642/15 "2003-04-30T06:54:41Z")

</div>

I agree… if used properly, frames is fine.

that is why I suggested iFrames…

Rev ![](http://www.aulman.com/rev.gif)

---

<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:** [April 30, 2003, 6:55am UTC](https://forum.kirupa.com/t/linking-flash-and-html/19642/16 "2003-04-30T06:55:56Z")

</div>

Ok… if you place a Flash SWF on an HTML layer then that layer can definitely be controlled by JavaScript. It will only be the HTML layer under JS control - not the Flash movie.

So…

```auto
 &lt; LAYER NAME = myLayer HEIGHT = 50 WIDTH = 89 LEFT = 93 TOP = 91 VISIBILITY = HIDE&gt;
    somemovie.swf
&lt;/LAYER &gt;

```

Everything inside the LAYER tags is part of that layer. To make a layer visible, set it’s VISIBILITY parameter to “SHOW”. To hide a layer, simply tell it to “HIDE”. To control a layer through JavaScript start by defining it. For example, to define “myLayer”:

```auto
    var myLayer = document.layers["myLayer"];

```

Then you can set visibility using something like:

```auto
myLayer.visibility = "HIDE";

```

You could combine this with some kind of timer, I guess, but my JS isn’t quite so good. This is probably a contender for the Random forum as it’s not really FMX related.

---

<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:** [April 30, 2003, 8:18am UTC](https://forum.kirupa.com/t/linking-flash-and-html/19642/17 "2003-04-30T08:18:27Z")

</div>

Whats Iframes, reall quick…

---

<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:** [April 30, 2003, 10:22am UTC](https://forum.kirupa.com/t/linking-flash-and-html/19642/18 "2003-04-30T10:22:58Z")

</div>

iframes are a way of including another html page within the page you are on. They work in a similar way to normal frames. They are not compatible with some early versions of netscape and other non ie browsers. I doubt that they will solve your problem though i’d look for a javascript timer although even this might be not be the most reliable thing.

However here’s an example of how they work, copy and paste this into a html page

\<iframe src=“[http://www.coalporters.org](http://www.coalporters.org)” width=“500” height=“400” align=“left” hspace=“20” name="#myiframe"\>  
\<B\>Sorry iframes are unsupported on this browser\</B\>  
\</iframe\>

\<br\>\<br\>  
\<a href=“[http://www.bbc.co.uk](http://www.bbc.co.uk)” target="#myiframe"\>page1\</a\>\<br\>  
\<a href=“[http://www.thesun.co.uk](http://www.thesun.co.uk)” target="#myiframe"\>page2\</a\>

You still need an event to trigger changing the targets so thats why you would need the javascript. You can remove the scroll bars by adding extra commands to the iframe (but i cant remember what they are probably scroll=false or something similar)

---

<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:** [April 30, 2003, 10:32am UTC](https://forum.kirupa.com/t/linking-flash-and-html/19642/19 "2003-04-30T10:32:37Z")

</div>

Err sorry guys wasnt meant for it to do that i don’t know how to post the code I want to show you in here

---

<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:** [April 30, 2003, 10:58am UTC](https://forum.kirupa.com/t/linking-flash-and-html/19642/20 "2003-04-30T10:58:53Z")

</div>

you may have to attach it as an html file.

[Next page](https://forum.kirupa.com/t/linking-flash-and-html/19642.md?page=2)
