PDA

View Full Version : Using NR.FILE.Path



jwilson56
May 13th, 2009, 06:40 AM
I have been playing around with some flash objects. Using the command

file:///C:/flash/Calculator.swf

in the Flash Component parameters works fine but I would like it to load from the CCF path. What would be the syntax for doing that?

Rob H
May 13th, 2009, 08:24 AM
I'd suggest using a NetRemote variable in <> brackets for the path e.g. <FlashPath>. Then have something like
NetRemote.RegisterVariableWatch("FlashPath", function() NetRemote.Rebind() end)

That should work.

jwilson56
May 13th, 2009, 09:11 AM
I think you misunderstood my question....probably was not clear enough on my part....

Ok lets try this....

Lets say I load a CCF called test.ccf which sits in c:\testme folder

I also have a flash swf file in c:\testme called calc.swf

I want to set a variable when the CCF is loaded called swfpath that can be used as shown in the screen capture.

What is the syntax for doing that? (The second screenshot shows the hard coded path in the Movie URL field which works fine)

Rob H
May 13th, 2009, 09:21 AM
So you mean something like


function OnCCFLoad()
NetRemote.SetVariable("swfpath", NetRemote.GetVariable("NR.FILE.Path") .. "\\calc.swf")
end


Does using {swfpath} actually work? I would probably use <swfpath> instead, but I'd have to check whether the Flash plugin allows the first form.

jwilson56
May 13th, 2009, 09:25 AM
Thanks... that worked.... actually it needs the { } to work....FYI

Rob H
May 13th, 2009, 10:17 AM
Thanks, I'll have to take a look at the Flash plugin, looks like it needs to have support for Rebind adding.