Source language: Translate to:

NeoBook Variables to Flash

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

NeoBook Variables to Flash

Postby AsleyCruz » Mon May 20, 2013 11:49 pm

Hi Guys 8)
I need your help... if you can help me, cool :wink:

(I know how to make actions from flash to neobook, but neobook to flash, not!)

In flash I have this variable: Status = "Yes";
I want that when I press a NeoBook Button, the value of the variable "Status" change to "No".

Let's say that the new value of the variable would be: Status = "No";

Someone can help me? how?
Well, many thanks in advanced... :wink:

.
AsleyCruz
Freelancer - Graphic & Type Designer

FREE NEOBOOK APPS: See Website

.
User avatar
AsleyCruz
 
Posts: 108
Joined: Fri Sep 16, 2011 2:12 pm

Re: NeoBook Variables to Flash

Postby dpayer » Tue May 21, 2013 8:14 am

ernesto wrote:Hi Guys 8)
I need your help... if you can help me, cool :wink:

(I know how to make actions from flash to neobook, but neobook to flash, not!)
.


I had/have a similar problem trying to send a variable to a flash file inside a NB app. I think the issue in my case deals with the fact that the file expects the variable to be available on loading/initiation and not just at my convenience (inserted later, after file was already in NB app).

Here is a tool I use at work with flash files to make sure a flash file uses variables correctly:
Code: Select all
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Flash File test</title>
</head>
<body bgcolor="#000000" bottommargin="0" topmargin="0" leftmargin="0" rightmargin="0">
   
   <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"

codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="PIXELS1" height="PIXELS2" id="scn9_DRAW"

align="middle">
   <param name="allowScriptAccess" value="sameDomain" />
   <param name="movie" value="flashfilename.swf" />
   <param name="quality" value="high" />
   <param name="bgcolor" value="#000000" />
   <param name="flashvars" value="Variable1=Value1&Variable2=Value2" />
   <embed src="flashfilename.swf" quality="high" bgcolor="#000000" width="PIXELS1" height="PIXELS2" name="testvar" align="middle"

allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
   </object>
</body>
</html>

Copy this out, and set values for PIXELS1 (two places), PIXELS2 (two places), Variable1, Value1, Variable2, Value2, (NOTE: you can have as many variables as you want or just one, separate them by the ampersand {&} and don't have any quotes in values as this will end the variable statement) flashfilename.swf and save as a html file in the same folder your flash file is in. When you launch this HTML file, it should display your flash and insert the variables. If your file works with this, then I think you have the same issue I do, the file is expecting the variable name before it is available. The HTML file gives the variable values at initiation of the flash file, not afterward. Somehow I need NB to do this and I don't know how to make it happen.

David P.
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1384
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: NeoBook Variables to Flash

Postby shx » Wed May 22, 2013 6:44 am

I also had this issue where I couldn't pass variables.

Please share any straight solutions
- Steven
User avatar
shx
 
Posts: 167
Joined: Sun Apr 03, 2005 5:49 am

Re: NeoBook Variables to Flash

Postby Gaev » Wed May 22, 2013 9:50 am

Not sure if everybody is on the same page here ... DavidP is talking about a Flash file (swf) defined inside an html that would be running within a Web Browser object of NeoBook.

But you can also play an swf file inside the NeoBook Flash object ... which has supporting commands like ...

FlashSetVar
FlashGetVar

Perhaps the forum posters need to clarify which technique they are attempting to deploy.
User avatar
Gaev
 
Posts: 3738
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: NeoBook Variables to Flash

Postby AsleyCruz » Wed May 22, 2013 10:01 am

Hi Gaev :-)
You have given us the solution. I had it in front of my eyes ...
... but now is solved ... Many thanks :wink:

Gaev wrote:Not sure if everybody is on the same page here ... DavidP is talking about a Flash file (swf) defined inside an html that would be running within a Web Browser object of NeoBook.

But you can also play an swf file inside the NeoBook Flash object ... which has supporting commands like ...

FlashSetVar
FlashGetVar

Perhaps the forum posters need to clarify which technique they are attempting to deploy.
AsleyCruz
Freelancer - Graphic & Type Designer

FREE NEOBOOK APPS: See Website

.
User avatar
AsleyCruz
 
Posts: 108
Joined: Fri Sep 16, 2011 2:12 pm

Re: NeoBook Variables to Flash

Postby dpayer » Wed May 22, 2013 12:04 pm

Gaev wrote:Not sure if everybody is on the same page here ... DavidP is talking about a Flash file (swf) defined inside an html that would be running within a Web Browser object of NeoBook.

But you can also play an swf file inside the NeoBook Flash object ... which has supporting commands like ...

FlashSetVar
FlashGetVar

Perhaps the forum posters need to clarify which technique they are attempting to deploy.



No Gaev, I used that as a way to test the flash file to make sure the insertion of variables worked. When it doesn't work in NB, you don't know if it is NB or the Flash file. This way you can eliminate the flash as the problem.

I do think that NB is lacking something in this regard. When flashes I use load, they are expecting to have a variable at the onload moment. NB allows me to push a variable after that onload is done. For some flash files, that won't work.

David P
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1384
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: NeoBook Variables to Flash

Postby Gaev » Wed May 22, 2013 4:11 pm

David P:
No Gaev, I used that as a way to test the flash file to make sure the insertion of variables worked. When it doesn't work in NB, you don't know if it is NB or the Flash file. This way you can eliminate the flash as the problem.
Oops ... should have read the text surrounding the code more carefully.
I do think that NB is lacking something in this regard. When flashes I use load, they are expecting to have a variable at the onload moment. NB allows me to push a variable after that onload is done. For some flash files, that won't work.
I see what you mean.

After Google'ing "flashvars", I read some of the resulting links ... and came across a tidbit of information that may provide a solution ... it says that you can pass variable values at "file load time" other than by using ...

<param name="flashvars" value="Variable1=Value1&Variable2=Value2" />

... by appending these name/value pairs to the name of the swf file ... same as a query string you supply in the url of an html/php etc. file.

Perhaps you can try this technique to pass variables in the NeoBook Flash object i.e. if you normally specified [PubDir]myFlashFile.swf as the value of the "Flash File or URL" property of the Flash object, try ...

[PubDir]myFlashFile.swf?Variable1=Value1&Variable2=Value2


Also, try it with a file on the web e.g. ...

http://www.myDomain.com/path/to/myFlash ... le2=Value2

... as I have a faint recollection that, for security reasons, Adobe/Flash balks at some functionality when the swf file is local.
User avatar
Gaev
 
Posts: 3738
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: NeoBook Variables to Flash

Postby dpayer » Thu May 23, 2013 9:17 am

Gaev wrote:Perhaps you can try this technique to pass variables in the NeoBook Flash object i.e. if you normally specified [PubDir]myFlashFile.swf as the value of the "Flash File or URL" property of the Flash object, try ...

[PubDir]myFlashFile.swf?Variable1=Value1&Variable2=Value2


Thanks for the suggestion. NB won't load the file with attributes it considers them part of the file name.

I did look more into the flash object in NB and it allows you to set the file to wait for a start command. I tried sending the variable first and then starting the file but that did not do it either. My file works with the web page method of loading vars but not the NB method.

Still on the drawing board on this one. My workaround has been to use a WebBrowser object for my flash files and write the variables into it. That works for me so far.

David P.
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1384
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: NeoBook Variables to Flash

Postby Gaev » Thu May 23, 2013 12:58 pm

David P:
NB won't load the file with attributes it considers them part of the file name.
Bummer ... I trust you also tried it using a URL e.g. http://www.yourDomain/etc/etc
I did look more into the flash object in NB and it allows you to set the file to wait for a start command. I tried sending the variable first and then starting the file but that did not do it either. My file works with the web page method of loading vars but not the NB method.
Another possibility could be that requests made using NeoBookk's FlashSetVar command only work to "update" existing variables inside the Flash file ... so, another suggestion would be to "initialize" the variables in the Flash file's onLoad section ... then wait a couple of seconds after the Flash file starts ... and try and "update" the variable's value via the NeoBook command.

Otherwise, I am all out of ideas ... perhaps Dave can throw some light on this.
User avatar
Gaev
 
Posts: 3738
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: NeoBook Variables to Flash

Postby Neosoft Support » Fri May 24, 2013 12:06 pm

Are these flash files that you've created yourself or are they from another source?

If you've created them yourself or have access to the source, couldn't you just retrieve the desired variable values from NeoBook from the Flash file's OnLoad event instead of pushing them from NeoBook?
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5605
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: NeoBook Variables to Flash

Postby dpayer » Fri May 24, 2013 2:08 pm

Neosoft Support wrote:Are these flash files that you've created yourself or are they from another source?

If you've created them yourself or have access to the source, couldn't you just retrieve the desired variable values from NeoBook from the Flash file's OnLoad event instead of pushing them from NeoBook?



Where I work, we have Flash developers that produce files to display on a network of retailers throughout the state. They have the ability to display dynamic data via the variables. They work fine in the application they were designed for. I test these slides for usability with the HTML file I showed above as we have to demonstrate they can accept the values pushed to them via the proprietary process.

I am attempting to use the same slides in a NB app for training purposes. I could not get the NB method of pushing variable values to the flash so I load the flash in a webbrowser object using a specially written HTML file that contains the variables.

I may have to see if I can get an uncompiled flash file to try what you suggest. Is there an example somewhere of how we get data FROM NB using Actionscript?

Thanks.

David P.
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1384
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: NeoBook Variables to Flash

Postby Neosoft Support » Fri May 24, 2013 4:17 pm

What I know about Flash's ActionScript could safely fit inside a thimble with room to spare. You can access NeoBook actions using Flash's fsCommand. Not knowing much about ActionScript, I don't know if this helps or not.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5605
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: NeoBook Variables to Flash

Postby dpayer » Sat May 25, 2013 7:25 am

Neosoft Support wrote:What I know about Flash's ActionScript could safely fit inside a thimble with room to spare. You can access NeoBook actions using Flash's fsCommand. Not knowing much about ActionScript, I don't know if this helps or not.


I guess I need some syntax example from someone with experience of pulling a NB variable into Flash using the FScommand.

If someone has done that, post it here.

David P.
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1384
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: NeoBook Variables to Flash

Postby Gaev » Sat May 25, 2013 8:30 am

David P:
I guess I need some syntax example from someone with experience of pulling a NB variable into Flash using the FScommand.

If someone has done that, post it here.
Download the sample from http://www.scriptedlogic.com/neoFREE2.htm

It will demo the NeoBook (pub) side of the solution ... unfortunately, I do not have the source of the swf file (where the fscommand would be) as the swf file was created using a utility program that no longer exists (vendor went out of biz).

However, the NeoBook Help file on the Flash object has a brief description about coding the fsCommand.
User avatar
Gaev
 
Posts: 3738
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: NeoBook Variables to Flash

Postby Neosoft Support » Tue May 28, 2013 11:57 am

Gaev,

Thanks for the sample!
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5605
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 0 guests