Use of callfunction in combination with VC, VB, C # And flash8 Development

Source: Internet
Author: User

Not long ago, I wrote a essay about the Interactive Development of flash and Microsoft products, which received a lot of attention from webpages, but few people participated in the discussion.ArticleAddress: Please discuss the programming of the combination of flash. ocx (8.0) and. net. ) At that time, I left a problem: how to use callfunction of the object in flash8.ocx, now I am here to simply compensate for the use of callfunction, Note that the SWF file must be created in flash8.0 and flash control in flash8.ocx.
VB description (pass multiple parameters)
VB end
Private sub commandementclick ()
Flash1.callfunction "<invoke name =" "show" "returntype =" "XML"> <arguments> <string> Hello </string> <string> world </string> </ arguments> </invoke>" 'The length of the article is in line with the above
End sub
Private sub form_load ()
Shockwaveflash1.loadmovie 0, app. Path & "\ showstring.swf"
End sub
Flash end
① Add a text box text_txt to display the effect
② ActionScript Code Is
Function show (str1: String, str2: string): void {
Test_txt.text = str1 + ":" + str2;
}
Flash. External. externalinterface. addcallback ("show", this, show );
C ++ or C # description (only one parameter is passed, used)
MasterProgramTerminal:
Flash1.loadmovie (0, application. startpath +" \ Showstring.swf");
Flash1.callfunction ("<invoke name = \" test \ "returntype = \" XML \ "> <arguments> <string> helloworld </string> </arguments> </invoke>" );
Flash end:
① Add a text box text_txt to display the effect or use trace ("call:" + Result + "")
② The following is the ActionScript code. The result is only a parameter, but the parameter name does not need to be concerned when the main program uses the as function. Only the number of parameters or the parameter location are known.
Function Test (Result: Object): void {
Test_txt.text = result;
}
Flash. External. externalinterface. addcallback ("test", this, test );
From the above, we can see that flash has supported calling The ActionScript Script Function to an external program in multiple versions of flash8.0, and passed parameters using XML, this brings great convenience and Development inspiration to many programmers.
As an example, leave a question for your consideration,That is, if you want to pass a dataset, such as a SQL query table, how can the flash end write, and how the VB or VC ++ end write (XML ), do not use a record to upload a recordIf you are interested, you can reply.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.