Source language: Translate to:

Using PFlash with no browser and no javascript

Questions about NeoBook PlugIns

Moderator: Neosoft Support

Using PFlash with no browser and no javascript

Postby luishp » Mon Jun 21, 2010 6:29 am

Hi everyone.

I've had some time to play with MatActiveX plugin and PFlash.
I have found the way to call any actionscript function inside a .swf file directly from NeoBook.
It's necessary to pass the arguments in a proper XML format, but its quite simple.

I will try to show how to do it with a sample code:

Code: Select all
.first we need to load the Flash ocx control
MatActiveHost_Create "Rectangle1" "[pubdir]flash10b.ocx" "0" "False"

.then we load PFlash .swf file into the Flash ActiveX container
MatActiveHost_SetProperty "Rectangle1" "Movie" "[pubdir]pf3.swf"

.Now we can call any PFlash function. Start by creating a Clip
.using pf.createclip("uno")
.the pf. prefix is not necessary as we are not using javascript.
MatActiveHost_CallFunc "Rectangle1" "CallFunction" "<invoke name='createclip' returntype='xml'><arguments><string>uno</string></arguments></invoke>" "[none]"

.define line style to draw
.calling pf.linestyle("uno",2,0x000000,1)
.see PFlash help file to know about each argument
MatActiveHost_CallFunc "Rectangle1" "CallFunction" "<invoke name='linestyle' returntype='xml'><arguments><string>uno</string><number>2</number><number>0x000000</number><number>1</number></arguments></invoke>" "[none]"

.Finally we draw to lines using
.calling pf.line("uno",0,0,100,100) and pf.line("uno",100,0,0,100)
MatActiveHost_CallFunc "Rectangle1" "CallFunction" "<invoke name='line' returntype='xml'><arguments><string>uno</string><number>0</number><number>0</number><number>100</number><number>100</number></arguments></invoke>" "[none]"

MatActiveHost_CallFunc "Rectangle1" "CallFunction" "<invoke name='line' returntype='xml'><arguments><string>uno</string><number>100</number><number>0</number><number>0</number><number>100</number></arguments></invoke>" "[none]"


If you run the above sample you will get a nice cross
Remember you will need both files flash10b.ocx and pf3.swf.
You will need MatActiveX plugin too.

I have put all the necessary files to run this sample here:

http://drop.io/pflash_activex
User avatar
luishp
 
Posts: 359
Joined: Wed May 23, 2007 10:17 am
Location: Spain

Postby asawyer13 » Wed Mar 30, 2011 12:57 pm

I think this link is dead.
Alan
asawyer13
 
Posts: 123
Joined: Sun Aug 22, 2010 6:13 pm

Postby Neosoft Support » Wed Mar 30, 2011 1:51 pm

NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5603
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby asawyer13 » Wed Mar 30, 2011 1:53 pm

I was meaning the drop.io link that had the example.
Thanks,
Alan
asawyer13
 
Posts: 123
Joined: Sun Aug 22, 2010 6:13 pm


Return to PlugIn Discussions

Who is online

Users browsing this forum: No registered users and 2 guests