آیا TLFTextField را می توان در .net لود کرد؟

mohamdmahdi

New Member
سلام
آیا می وشود یک swf که حاوی TLFTextField است را که با as3 نوشته شده در .net لود کرد.

خواهشا حرفه ای ها جواب دهند اگر نمی خواهند عمومی بگویند این ایمیل من است

mohamadmahd@ gmail.com
 

++Hadi++

Active Member
بله به شرطی که کامپوننت لود swf فلش پلیر 10 رو که tlf رو ساپورت می کنه ، در دات نت استفاده کنید .
 

mohammad.sub7

کاربر فعال
از فلش که با تابع fscommand دستور رو میفرستی به .net از .net هم که با کمک کامپوننت shokwave flash میتونی فلش رو مدیریت

کنی
 

mohammad.sub7

کاربر فعال
اصلاً به اکشن 2 یا 3 مربوط نیست. با اکشن 3 مسیر fscommand بدی بعد تو .net فراخونی میتونی کنی. حالا فرقی نداره چه دکمه چه فریم

برعکسشم همون کامپوننت shokwave کار میکنه. از ویژوال studio 2008 به بالا استفاده کن
 

++Hadi++

Active Member
مي توني با fscommand توابع داخل C# رو از توي فلش فراخواني كني و بهش مقدار پاس بدي و با استفاده از External Interface مقادير و داده ها رو از C# به فلش پاس بدي . در واقع با مورد دوم مي تونين از داخل C# ،‌يكي از توابع اكشن رو صدا زده و بهش مقدار پاس بدين .
نمونه اش تو آموزش swfkit كه تو امضامه هست .(لينك هاي مهم هادي)
 
دوستان تشکر

http://stackoverflow.com/questions/472234/calling-actionscript-3-function-from-c



In order to make an ActionScript function callable from your Flash player's host, you have to use the ExternalInterface.addCallback function, for example:​


کد:
ExternalInterface.addCallback("testCallback", function (text : String) : String
{
    var helloText : String = "Hello, " + text;
    myTextField.text = helloText;
    return helloText;
});


In order to call this function from your Windows Forms application in C#, you have to use the CallFunction method exposed by the Flash player component. The method has one string argument, which must contain an XML that describes the call; it returns a string which contains an XML that describes the return value. Using the example above, this would be way to call the testCallback function:



کد:
textBox1.Text = flash.CallFunction("<invoke name=\"testCallback\" returntype=\"xml\"><arguments><string>" + textBox1.Text + "</string></arguments></invoke>");

Supposing that your text box (textBox1) contained the text "World", upon executing the code above it would contain the text "Hello, World".

If you want to call C# code from Flash, the story is similar: you have to define an event handler for your Flash player's FlashCall event. Then you would use a following type of call from ActionScript:



کد:
ExternalInterface.call("MyCSharpFunction", 17);

This would make the Flash player raise the FlashCall event and call your event handler. The event argument your handler receives has a public field called "request", whose type is string. The request field contains an XML that describes the call made from Flash. For the example used above, it would look like this:

کد:
<invoke name="MyCSharpFunction" returntype="xml"><arguments><number>17</number></arguments></invoke>

Should you wish to return a value, all you would have to do in your FlashCall event handler is call the Flash player's SetReturnValue method before the event handler returns, passing it the string with the XML that describes the return value, such as:

کد:
<string>Works like a charm!</string>
 

جدیدترین ارسال ها

بالا