I use this code to achieve the purpose.
Maybe there is some another better way to do it.
###
<lift:surround with="default" at="content">
<head>
<script type="text/javascript" src="/scripts/swfobject.js"></script>
<script type="text/javascript">
<lift:HelloWorld.initFlash>
<init:flash />
</lift:HelloWorld.initFlash>
</script>
</head>
###
class HelloWorld {
lazy val date: Box[Date] = DependencyFactory.inject[Date] // inject
the date
def howdy(in: NodeSeq): NodeSeq =
Helpers.bind("b", in, "time" -> date.map(d => Text(d.toString)))
var flashSrc = "/flash/test.swf"
def initFlash(in: NodeSeq) : NodeSeq = {
bind("init", in,
"flash" -> Text("""swfobject.embedSWF({flashSrc}, "myContent",
"300", "120", "9.0.0", "expressInstall.swf");""")
)
}
}
###
Cheers,
Neil
On Nov 8, 12:56 pm, "Neil.Lv" <[email protected]> wrote:
> Tim,
>
> How can i use the lift to generate the dynamic flashvars ? In the
> snippet ?
>
> In the rails we can use the <%= %> to get the value that from the
> server.
>
> Cheers,
> Neil
>
> On Nov 8, 12:48 pm, "Neil.Lv" <[email protected]> wrote:
>
> > Thank you very much!
>
> > This is very cool! :)
>
> > Cheers,
> > Neil
>
> > On Nov 8, 2:52 am, Timothy Perrett <[email protected]> wrote:
>
> > > Looks to me like a javascript issue - if your rendering flash, use
> > > swfobject:
>
> > >http://code.google.com/p/swfobject/
>
> > > Cheers, Tim
>
> > > On 7 Nov 2009, at 18:49, Neil.Lv wrote:
>
> > > > Hi all,
>
> > > > I have a silly question about the embeded flash in the Firefox .
>
> > > > The code like this (in the main/webapp/index.html page), and i added
> > > > the
> > > > /* <![CDATA[ */ in the script,
>
> > > > It can show correctly in the IE browser, but it doesn't shown in the
> > > > Firefox ?
>
> > > > There is something wrong with it ?
>
> > > > ###
> > > > <script type="text/javascript">
> > > > /* <![CDATA[ */
> > > > document.write('<object classid="" codebase="" ....>');
> > > > document.write('<param name="movie" value="/flash/focus.swf">');
> > > > document.write('<param name="quality" value="high"><param
> > > > name="wmode" value="opaque">');
> > > > document.write('<param name="FlashVars" value="...">');
> > > > document.write('<embed src="/flash/focus.swf" FlashVars=""
> > > > quality="high" .... />');
> > > > document.write('</object>');
> > > > /* ]]> */
> > > > </script>
> > > > ###
>
> > > > Thanks for any suggestion !
>
> > > > Cheers,
> > > > Neil
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---