Forum: Ruby on Rails linking a .swf file in a rails document

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Eea3feaacbe44706164289d068d94828?d=identicon&s=25 Peter Michaux (Guest)
on 2006-02-25 05:03
(Received via mailing list)
Hi,

I have a little .swf movie I'd like to have in my page. Is there a
rails way of linking it?

Thanks,
Peter
30269682335f1fb247d71969fa715b5e?d=identicon&s=25 Roberto Saccon (rsaccon)
on 2006-02-25 06:13
(Received via mailing list)
No. But you could use http://blog.deconcept.com/flashobject/ and build a
Rails Helper around it.

btw.  Campfire (37Signals, DHH)  also seems to use flash.  I took a look
at
the HTML sources a few days ago and they seem to include the Macromedia
Flash/JS bridge, which also contains functions for embedding a swf.
0091f92762685860109bbcb02edfdf27?d=identicon&s=25 Alain Ravet (Guest)
on 2006-02-25 10:50
(Received via mailing list)
Peter
    > I have a little .swf movie I'd like to have in my page. Is there a
    > rails way of linking it?

It's not a Rails way, but the standard html way works fine:

Example (C&Pasted from a working app.) :

     <html>
      ....
		  <p>
		    <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"

codebase="http://download.macromedia.com/pub/shockwave/cabs/...
		 WIDTH="550" HEIGHT="400" id="CGAintro" ALIGN="">
		      <PARAM NAME=movie VALUE="your_movie.swf">
		      <PARAM NAME=loop VALUE=false>
		      <PARAM NAME=quality VALUE=high>
		      <PARAM NAME=bgcolor VALUE=#003366>
		      <EMBED src="your_movie.swf" tppabs="your_movie.swf" loop=false
quality=high bgcolor=#003366  WIDTH="550" HEIGHT="400" NAME="CGAintro"
ALIGN=""
		 TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
		      </EMBED>
		    </OBJECT> </p>
		  <p><%= link_to "Skip intro" , {:action => :home} %></p>


Alain
Eea3feaacbe44706164289d068d94828?d=identicon&s=25 Peter Michaux (Guest)
on 2006-02-25 17:35
(Received via mailing list)
Hi Alain,

Thanks for the code snip. Where is your file "your_movie.swf"?

Peter
0091f92762685860109bbcb02edfdf27?d=identicon&s=25 Alain Ravet (Guest)
on 2006-02-25 20:22
(Received via mailing list)
Peter
    > Thanks for the code snip. Where is your file "your_movie.swf"?


In the public root :

      <rails_app_root>/public/your_movie.swf


Alain
B417e47d2bebb33ca5adfa7e1a4f6f1d?d=identicon&s=25 chems (Guest)
on 2006-02-27 18:55
Alain,

I tested but seems not working for me. Got a message like movie not
loaded
I pasted your code in a rhtml file, and include the .swf in the public
directory
Any help

Rgs
Eea3feaacbe44706164289d068d94828?d=identicon&s=25 Peter Michaux (Guest)
on 2006-02-27 21:12
(Received via mailing list)
Hi Rgs,

I got this working but had a problem at first also. My problem was I
didn't notice that the .swf filename is written twice in Alain's code.
When I changed both then everything was ok. It was even ok if I moved
the file into my images directory and used 'images/theFIle.swf' twice
in Alain's code.

Peter
16ca81430f5a96a3ffd6d1eed49b63ed?d=identicon&s=25 Carlos Aldas (slayers20)
on 2010-07-20 20:52
I've have another problem, every time I go to another page the flash
dissapears, It's like the link changes.

I'm using the flash in a layout placed in every page of the system.

Can you help me please?!
Dd2d775dea75b381edb1bbf0600a0907?d=identicon&s=25 Marnen Laibow-Koser (marnen)
on 2010-07-20 21:09
Carlos Aldas wrote:
> I've have another problem, every time I go to another page the flash
> dissapears, It's like the link changes.
>
> I'm using the flash in a layout placed in every page of the system.
>
> Can you help me please?!

Check the generated HTML.  Make sure it's pointing to the URL you expect
it to.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
marnen@marnen.org
This topic is locked and can not be replied to.