[Lift] Re: How to Embed the flash dynamic in Snippet in the Lift ?

2009-11-12 Thread Timothy Perrett

Neil,

Try this:
  
  import net.liftweb.http.js._
  import net.liftweb.http.js.JE._
  import net.liftweb.http.js.JsCmds._
  
  val script = swfobject.embedSWF(' + flashSrc + ','myContent', '300', 
'120', '9.0.0', 'expressInstall.swf', ' + flashVar + ');

  def whatever(xhtml: NodeSeq): NodeSeq = bind(flash, xhtml,
object - Script(Run(script))
  )

That should give you enough to work out what it is you need to do. 

Cheers, Tim


On 12 Nov 2009, at 09:04, Neil.Lv wrote:

 
 Hi all,
 
  How to Embed the flash dynamic in Snippet in the Lift?
 
  I use the swfobject to embed my flash and want to specify the
 flashVar dynamic, but this is doesn't work!
 
  Here is the code in the Snippet:
 
  The flashSrc  can shown correctly in the index page, but the
 falshvar doesn't work!
 
 ###
  var flashSrc = /flash/test.swf
  var flashVar = {name1=helloname2=worldname3=foobar}
  def initFlash(in: NodeSeq) : NodeSeq = {
   bind(init, in,
   flash - Text(swfobject.embedSWF(' + {flashSrc} + ',
 'myContent', '300', '120', '9.0.0', 'expressInstall.swf', ' +
 {flashVar} + ');)
   )
  }
 ###
 
  Any help would be much appreciated!
 
 Cheers,
  Neil
  
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: How to Embed the flash dynamic in Snippet in the Lift ?

2009-11-12 Thread Neil.Lv

Tim,

  Here is the html code when i use the code in my Snippet, but it
doesn't work.

### Code in the Snippet ###
  var flashSrc = /flash/test.swf
  var flashVar = {name1=helloname2=worldname3=foobar}
  val script = swfobject.embedSWF(' + flashSrc + ', 'myContent',
'300', '120', '9.0.0', 'expressInstall.swf', ' + flashVar + ');

  def whatever(xhtml: NodeSeq): NodeSeq = bind(flash, xhtml,
flashVar - Text(/flash/focus.swf),
object - Script(Run(script))
  )
### Code in the Snippet ###

### Code in the index.html ###
head
  script type=text/javascript src=/scripts/swfobject.js/script
  lift:HelloWorld.whatever
flash:object /
  /lift:HelloWorld.whatever
/head
div id=myContent
  h1Alternative content/h1
  pa href=http://www.adobe.com/go/getflashplayer;img src=http://
www.adobe.com/images/shared/download_buttons/get_flash_player.gif
alt=Get Adobe Flash player //a/p
/div
### Code in the index.html ###

  This is the source html code when i use this code.

head
script type=text/javascript
//
swfobject.embedSWF(' + flashSrc + ', 'myContent', '300', '120',
'9.0.0', 'expressInstall.swf', ' + flashVar + ');
//
/script
/head
body
object height=120 width=300 type=application/x-shockwave-flash
data=' + flashSrc + ' id=myContent style=visibility: visible;/
/body

  Why the  flashSrc is a string in the Script ? Maybe it should be /
flash/test.swf ?

  Thanks very much!

Cheers,
  Neil



On Nov 12, 5:39 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 Neil,

 Try this:

   import net.liftweb.http.js._
   import net.liftweb.http.js.JE._
   import net.liftweb.http.js.JsCmds._

   val script = swfobject.embedSWF(' + flashSrc + ','myContent', '300', 
 '120', '9.0.0', 'expressInstall.swf', ' + flashVar + ');

   def whatever(xhtml: NodeSeq): NodeSeq = bind(flash, xhtml,
     object - Script(Run(script))
   )

 That should give you enough to work out what it is you need to do.

 Cheers, Tim

 On 12 Nov 2009, at 09:04, Neil.Lv wrote:



  Hi all,

   How to Embed the flash dynamic in Snippet in the Lift?

   I use the swfobject to embed my flash and want to specify the
  flashVar dynamic, but this is doesn't work!

   Here is the code in the Snippet:

   The flashSrc  can shown correctly in the index page, but the
  falshvar doesn't work!

  ###
   var flashSrc = /flash/test.swf
   var flashVar = {name1=helloname2=worldname3=foobar}
   def initFlash(in: NodeSeq) : NodeSeq = {
     bind(init, in,
     flash - Text(swfobject.embedSWF(' + {flashSrc} + ',
  'myContent', '300', '120', '9.0.0', 'expressInstall.swf', ' +
  {flashVar} + ');)
     )
   }
  ###

   Any help would be much appreciated!

  Cheers,
   Neil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: How to Embed the flash dynamic in Snippet in the Lift ?

2009-11-12 Thread Timothy Perrett

Its a string because you havent properly escapped it... note that the code i 
sent used the CONTENT markers, thus you need to escape them properly.

Cheers, Tim

On 12 Nov 2009, at 12:02, Neil.Lv wrote:

  Why the  flashSrc is a string in the Script ? Maybe it should be /
 flash/test.swf ?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: How to Embed the flash dynamic in Snippet in the Lift ?

2009-11-12 Thread Neil.Lv

Tim,

   It can be shown correctly now!

   It's so cool and easy to use.

   Thank you very much !

Cheers,
  Neil

On Nov 12, 9:08 pm, Timothy Perrett timo...@getintheloop.eu wrote:
 Its a string because you havent properly escapped it... note that the code i 
 sent used the CONTENT markers, thus you need to escape them properly.

 Cheers, Tim

 On 12 Nov 2009, at 12:02, Neil.Lv wrote:

   Why the  flashSrc is a string in the Script ? Maybe it should be /
  flash/test.swf ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---