Source language: Translate to:

Calling Flash ActionScript Functions

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Postby Gaev » Sat Dec 01, 2007 6:19 am

Hans-Peter:
(SWF Quicker and SwishMax seems currently only support AS2.)
It would be nice to know what version to investigate and to learn.
Luis is probably not going to be online for a while on account of his shoulder (surgery) ... but in email messages he told me ... I used a "hacked" version 3 of swfQuicker. The hacking is necessary to allow Flash 8 support and it's described on Sourcetec forum
I wonder how the flash player know the difference between the 2 flavours of Actionscript (1+2+3).
Is the version of the SWF used to switch to the different script-engines? So does a SWF saved from adobe's Flash CS3 automaticly use Actionscript3?
I am guessing that ...
Code: Select all
codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0 height="100%" width="100%"
... in the <object> tag tells the Player what the minimum version of the Player has to be ... if the user's version is not up to snuff, user gets a polite message and prompt to upgrade ... else, it uses the level of AS that goes with the Player ... and I believe that most of the commands in the older versions of AS are compatible (handled) with the syntax in the newer version ... though I have read forum topics that suggest there are a few exceptions where command syntax has changed or commands have been replaced or even no longer supported (for security reasons).
User avatar
Gaev
 
Posts: 3717
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby HPW » Sat Dec 01, 2007 6:26 am

Gaev,

Thanks for the info.

So when he use a Flash 8 SWF it is AS2 since AS3 was introduced with Flash 9.

Best wishes to Luis for his health.
Hans-Peter
User avatar
HPW
 
Posts: 2510
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby Gaev » Sat Dec 01, 2007 6:40 am

Hans-Peter:
So when he use a Flash 8 SWF it is AS2 since AS3 was introduced with Flash 9.
And I have Flash Player 9 on my machine ... everything works ... and (as the article from Adobe pointed out) it is amazingly fast ... in his latest demo, Luis has some (NeoBook) sliders ... given that every change to the values requires ...

- Slider Control to trigger NeoBook code
- NeoBook to interpret/service associated NeoBook script
- NeoBook to invoke BrowserExecScript
- Browser code to trigger call to Flash Player
- Flash Player to interpret request commands and render the image

.. it was very impressive how responsive the changes to the image were to my sliding ... lots of ideas about using this new found NeoBook capability are dancing in my head :D .
User avatar
Gaev
 
Posts: 3717
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby dpayer » Sat Dec 01, 2007 8:18 am

Gaev wrote:.. it was very impressive how responsive the changes to the image were to my sliding ... lots of ideas about using this new found NeoBook capability are dancing in my head :D .


I must stay this is very impressive.

It seems to harmonize with a discussion we had in the past about using the MSIE as an interface for NB. But the real marriage of interest may be Flash and NB.

OK, now I need to get a book on Action Script!

David
User avatar
dpayer
 
Posts: 1380
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Postby Gaev » Sat Dec 01, 2007 9:25 am

David:
OK, now I need to get a book on Action Script!
I seem to have misplaced my (previously downloaded) copy of the pdf document ... but try one of the results from Google Search ActionScript Dictionary
User avatar
Gaev
 
Posts: 3717
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby dpayer » Sat Dec 01, 2007 1:08 pm

I am not getting the call back button to display a NB Alert box.

I see it in the debugger but the alert does not pop up.

I am running the latest version of the demo pub that was offered in this thread. Can anyone confirm this?

This part of the code with the button, I am not sure I understand:

Code: Select all
;|pf.pf_callback([#34]level_0[#34],[#34]onclick[#34],nbcommand);"


The call to NB (the alert box) part is clear.
is the pf.pf_callback the instruction from flash to send back something to NB?
What is Level_0?
Is onclick a javascript or flash command?

what is the final nbcommand about? I thought it may be a on /off type of thing but putting in a slash only caused a separate error.

Do others get the alert box to work?

David
User avatar
dpayer
 
Posts: 1380
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Postby Gaev » Sat Dec 01, 2007 3:06 pm

David:

Ha ha ... I had a hard time with it too ... found it by accident ... by kicking a number of tires ... err, I mean buttons ... in random sequence.

You need to do these steps in sequence ...

a) Click on the button labelled Load Image

b) After you see the image, click on the button labelled onClick Callback

c) Now click on the image loaded in (a) ... will popup an alertbox that says "Hello from NeoBook" ... this is NeoBook servicing the the request for the script command ... AlertBox "PowerFlash" "Hello from NeoBook!!" ... proving that the path from the mouseclick to luishp's action script to FlashPalyer to Javascript in html to NeoBook to script command was accomplished.

Since this is just a demo, Luis was more focused on "demonstrating proof of concept" than making it intuitive to use.
User avatar
Gaev
 
Posts: 3717
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby dpayer » Sat Dec 01, 2007 9:26 pm

Gaev wrote:David:

Ha ha ... I had a hard time with it too ... found it by accident ... by kicking a number of tires ... err, I mean buttons ... in random sequence.

You need to do these steps in sequence ...

a) Click on the button labelled Load Image

b) After you see the image, click on the button labelled onClick Callback

c) Now click on the image loaded in (a) ... will popup an alertbox that says "Hello from NeoBook" ... this is NeoBook servicing the the request for the script command ... AlertBox "PowerFlash" "Hello from NeoBook!!" ... proving that the path from the mouseclick to luishp's action script to FlashPalyer to Javascript in html to NeoBook to script command was accomplished.

Since this is just a demo, Luis was more focused on "demonstrating proof of concept" than making it intuitive to use.


Got it. Thanks. Yes by having to click the image, not just the button, it is clear flash is pushing info back to NB.

D
User avatar
dpayer
 
Posts: 1380
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Postby luishp » Sun Dec 02, 2007 12:28 am

I'm back! Three weeks with inmobilized shoulder but hands free enough to use keyboard.

New demo version uploaded with new capabilities and easier to understand (i hope so):

http://www.hdezpena.com/archivos/easing/powerflash.zip

Hans: i use ActioScript Verion 1 & 2. They are compatible among them. Version 3 is different (and more tedious) and i do not have any tool to work with it yet.

Version is defined in the swf itself when you export it from a swf-tool software. Old versions are compatible 100% with new Flash Player.

Dpayer: don't forget to double-click on BrowserExecScript to see JavaScript clearly.

There are predefined "levels" = layers = movieClips to work with (level_0 ... level_100), but you can create your own.

I know documentation is a must... all will be coming.
Last edited by luishp on Sun Dec 02, 2007 4:00 am, edited 1 time in total.
User avatar
luishp
 
Posts: 357
Joined: Wed May 23, 2007 10:17 am
Location: Spain

Postby luishp » Sun Dec 02, 2007 12:57 am

This link is for Dave at NeoSoftware:

http://www.f-in-box.com/delphi/

Please take a look. It's a component for Delphi to allow all the missing Flash capabilities in NeoBook.
User avatar
luishp
 
Posts: 357
Joined: Wed May 23, 2007 10:17 am
Location: Spain

Postby HPW » Sun Dec 02, 2007 5:15 am



Dave knows this component, but as far as I know he uses his own code.
I own a license of f-in-box, but since neobook has native flash support I have not used it in neobook related projects.
I am also not sure that I would be allowed to build a wrapper around their component and to redistribute it as a plugin.
I am sure Dave could add the missing functions in his own code-base.
But that is always a problem with his time and resources, since he has the long list of wishes to work on.
(For example: Db Pro,The next maintainance release,Neobook 6,.....)

Version is defined in the swf itself when you export it from a swf-tool software. Old versions are compatible 100% with new Flash Player.


I know that old code run in flash's 9 AVM1.
But reading news on the internet bring up the wish to use AVM2, because rumors are telling about another big performance boost.

http://www.adobe.com/devnet/actionscrip ... erview.pdf

Anyway we are on the right track and one day we get also access on that flavour.
Hans-Peter
User avatar
HPW
 
Posts: 2510
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby luishp » Sun Dec 02, 2007 9:22 am

I don't think AVM1 is going to disappear soon.
Many developers prefer that one becouse simplicity and quick results.
In adition most mobile engines are still using Flash 6. (Play Station Portable included).
I think AS3 is great for complex projects but not so much for quick scripting.
User avatar
luishp
 
Posts: 357
Joined: Wed May 23, 2007 10:17 am
Location: Spain

Postby HPW » Sun Dec 02, 2007 10:07 am

I don't think AVM1 is going to disappear soon.
Many developers prefer that one becouse simplicity and quick results.


No offense. But freedom of choice is always the best.

I think AS3 is great for complex projects but not so much for quick scripting.


Why shouldn't we use it for complex projects? ;-)

By the way: The 'onClick Callback JavaScript' is not working for me.
Hans-Peter
User avatar
HPW
 
Posts: 2510
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby luishp » Sun Dec 02, 2007 10:20 am

Sorry, download the demo again please.
I missed the last .html file.
User avatar
luishp
 
Posts: 357
Joined: Wed May 23, 2007 10:17 am
Location: Spain

Postby luishp » Sun Dec 02, 2007 11:05 pm

Updated again.

http://www.hdezpena.com/archivos/easing/powerflash.zip

I think basic functionality is done.
Time for version 1.0 documentation?
Let me know your thoughts please.

I want this to be available for free in a NeoBook friendly way using functions as Gaev suggested.
Perhaps a plugin later to help even more to enter commands and parameters.

Would you help with this last point, Hans?
Your help would be very appreciated.

By the way, i'm thinking about porting it to ActionScript3 using the free Adobe Flex SDK or a 30 day trial copy of Adobe Flash CS3.
User avatar
luishp
 
Posts: 357
Joined: Wed May 23, 2007 10:17 am
Location: Spain

PreviousNext

Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 3 guests