Insert .swf with HTML?

General Moho topics.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
2ner
Posts: 171
Joined: Wed Aug 04, 2004 1:14 pm

Insert .swf with HTML?

Post by 2ner »

Does anybody know if it is possible to put the .swf file exported from Moho into a web page with simple HTML code?
User avatar
jahnocli
Posts: 3471
Joined: Fri Oct 29, 2004 2:13 pm
Location: UK

Post by jahnocli »

it's really easy. Publish a swf export from Flash, and then adapt it for your movie. If you haven't got Flash (Macromedia do a 30-day trial anyway), I can email you the code, or put it up here. It's very obvious what everything is, and what variables you need to change.

Jah
You can't have everything. Where would you put it?
User avatar
JohnO
Posts: 14
Joined: Sat Dec 04, 2004 9:45 pm
Location: Mercia, England

Post by JohnO »

Try something like this:

Code: Select all

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="100" height="100" title="A Flash Movie Made With Moho">
   <param name="movie" value="../relative_path/your_movie.swf" />
   <param name="quality" value="autolow" />
   <param name="wmode" value="transparent" />
   <embed src="../relative_path/your_movie.swf" width="100" height="100" quality="autolow" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>
</object>
Using both the 'object' and 'embed' tags should keep things cool for older browsers. Most of the parameters should be self explanatory, but here are a couple that you may need to tweak:

wmode... sets the display window type for the flash movie. options are 'opaque', transparent' or 'window'.
quality... sets the playback quality. options are 'low', 'medium', 'high', 'autolow', 'autohigh' and 'best'.
Eall cræft unnytt bið þonne Engel on þinum flintloce micgeð
User avatar
jahnocli
Posts: 3471
Joined: Fri Oct 29, 2004 2:13 pm
Location: UK

Post by jahnocli »

...there you go...
You can't have everything. Where would you put it?
User avatar
2ner
Posts: 171
Joined: Wed Aug 04, 2004 1:14 pm

Post by 2ner »

That's great! Thanks a lot. I was hoping it would be that simple.

So it actually goes to macromedia and dowloads the player? I thought the plugin was already in the browser.

I suppose there is a loop parameter?
User avatar
JohnO
Posts: 14
Joined: Sat Dec 04, 2004 9:45 pm
Location: Mercia, England

Post by JohnO »

The <object> 'codebase' and <embed> 'pluginspace' attributes identify where the browser can find the activex control and plugin respectively. They are not downloaded unless they are required - either because they are not already installed or the movie needs a newer player than the one currently installed.

Yup, there's a 'loop' attribute which can be either 'true' or 'false' for both the <object> and <embed> tags. The default value is 'true' so you don't generally need to include it.

John O
Eall cræft unnytt bið þonne Engel on þinum flintloce micgeð
User avatar
2ner
Posts: 171
Joined: Wed Aug 04, 2004 1:14 pm

Post by 2ner »

That code works fine JohnO. I don't have a website yet, but it works well on my system. Is there a way to play it forward then backward and keep looping like that?
User avatar
JohnO
Posts: 14
Joined: Sat Dec 04, 2004 9:45 pm
Location: Mercia, England

Post by JohnO »

'Fraid not. You'll have to build the SWF file to do that for you, which can be difficult if you don't have Flash. :cry:
Eall cræft unnytt bið þonne Engel on þinum flintloce micgeð
User avatar
2ner
Posts: 171
Joined: Wed Aug 04, 2004 1:14 pm

Post by 2ner »

That's ok, I could do it in Moho. I just noticed it was an option in an animated gif program I was looking at so I thought there might be a toggle for it. I've never played with flash before. It's pretty slick.
Thanks for the help.
Post Reply