锘??xml version="1.0" encoding="utf-8" standalone="yes"?>香蕉视频在线观看亚洲,三上悠亚亚洲一区高清,亚洲一区精品无码http://www.tkk7.com/aoneany/category/33800.html嬈蹭笂澶╁爞錛屽厛涓嬪湴鐙?/description>zh-cnFri, 04 Dec 2009 17:28:33 GMTFri, 04 Dec 2009 17:28:33 GMT60Flex涓嶤#浜や簰(swf)http://www.tkk7.com/aoneany/articles/303788.html娌欐紶涓殑楸?/dc:creator>娌欐紶涓殑楸?/author>Thu, 26 Nov 2009 08:51:00 GMThttp://www.tkk7.com/aoneany/articles/303788.htmlhttp://www.tkk7.com/aoneany/comments/303788.htmlhttp://www.tkk7.com/aoneany/articles/303788.html#Feedback0http://www.tkk7.com/aoneany/comments/commentRss/303788.htmlhttp://www.tkk7.com/aoneany/services/trackbacks/303788.htmlAs many C# developers know, it is easy to house an ActiveX control (the IE version of Flash Player) in a .NET Windows application. This means we can now load an SWF in our Windows application and easily send data back and forth. Keep in mind that the keyword in this statement is “easily;” although possible before, it was not nearly as simple as the External API makes it now!

C# to ActionScript Communication

As I said before, communication between Flash Player and its container has been made extremely easy. The new class that makes this process so easy is the ExternalInterface. We will begin in the ActionScript. First, we need to import this new class so we can use it (as2 only, in as3 it will work without the import):

import flash.external.ExternalInterface;

Next, we have to register any function we want to make available externally:

ExternalInterface.addCallback("addText", addText);

Basically, the code above will allow us to call the addText function (which I will show in a minute) from the C# application.
The addText function is as below. Basically, it takes a string input and appends it to a text box

function addText(val:String):void
{
inTxt.appendText(val + "\n"); // append text recieved from c#
}

That’s it from the ActionScript side. Now all we need to do is call the function from C#. First, I add an instance of the Flash Player ActiveX control to my form and load the SWF we created in the form’s constructor:

private AxShockwaveFlash player;
 
public DemoForm ()
{
...
player.LoadMovie(0, Application.StartupPath + "\\EITest.swf");
player.Play();
...
}

Next, all we have to do is call the externalized method when desired. In my case, it is in response to the user clicking the send button:

private void sendBtn_Click(object sender, EventArgs e)
{
player.CallFunction("" + outTxt.Text + "");
}

ActionScript to C# Communication

Again, you will need to use the ExternalInterface in the ActionScript:

function send(evt : Event):void
{
ExternalInterface.call("sendText", outTxt.text); // function to call and it's parameters
outTxt.text = ""; // reset text box
}

As you can see, I am calling a method sendText and passing the input string as a parameter. Now to receive the message in C#, we first have to subscribe to the FlashCall event. You can do this in the constructor or from the activex properties panel on events tab.

Now the call made in ActionScript will be received in the request property of the event argument. For my particular call, the XML will look like this:

<invoke name="sendText" returntype="xml">
<arguments>
<string>some text message here</string>
</arguments>
</invoke>

So now all we have to do is parse the XML in the event handler and invoke the C# function locally:

private void player_FlashCall(object sender, _IShockwaveFlashEvents_FlashCallEvent e)
{
// message is in xml format so we need to parse it
XmlDocument document = new XmlDocument();
document.LoadXml(e.request);
// get attributes to see which command flash is trying to call
XmlAttributeCollection attributes = document.FirstChild.Attributes;
String command = attributes.Item(0).InnerText;
// get parameters
XmlNodeList list = document.GetElementsByTagName("arguments");
// Interpret command
switch (command)
{
case "sendText" : resultTxt.Text = list[0].InnerText; break;
case "Some_Other_Command" : break;
}
}

闄勪歡錛?a href="http://www.tkk7.com/Files/aoneany/CFlashProject.zip">http://www.tkk7.com/Files/aoneany/CFlashProject.zip


]]>
FLEX鐨凪VC妗嗘灦鍥?/title><link>http://www.tkk7.com/aoneany/articles/301046.html</link><dc:creator>娌欐紶涓殑楸?/dc:creator><author>娌欐紶涓殑楸?/author><pubDate>Wed, 04 Nov 2009 06:04:00 GMT</pubDate><guid>http://www.tkk7.com/aoneany/articles/301046.html</guid><wfw:comment>http://www.tkk7.com/aoneany/comments/301046.html</wfw:comment><comments>http://www.tkk7.com/aoneany/articles/301046.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/aoneany/comments/commentRss/301046.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/aoneany/services/trackbacks/301046.html</trackback:ping><description><![CDATA[<strong style="color: red">PureMVC </strong> <p><img style="width: 520px; height: 403px" height="403" alt="" src="http://www.tkk7.com/images/blogjava_net/aoneany/images/PureMVC-A.jpg" width="520" border="0" /></p> <br /> <br /> <strong style="color: red">Cairngorm</strong><br />  <img style="width: 528px; height: 379px" height="379" alt="" src="http://www.tkk7.com/images/blogjava_net/aoneany/images/Cairngorm_patterns.png" width="528" border="0" /> <img src ="http://www.tkk7.com/aoneany/aggbug/301046.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/aoneany/" target="_blank">娌欐紶涓殑楸?/a> 2009-11-04 14:04 <a href="http://www.tkk7.com/aoneany/articles/301046.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Actionscript 3 鍦ㄧ嚎緙栬瘧鍣?/title><link>http://www.tkk7.com/aoneany/articles/239062.html</link><dc:creator>娌欐紶涓殑楸?/dc:creator><author>娌欐紶涓殑楸?/author><pubDate>Thu, 06 Nov 2008 08:53:00 GMT</pubDate><guid>http://www.tkk7.com/aoneany/articles/239062.html</guid><wfw:comment>http://www.tkk7.com/aoneany/comments/239062.html</wfw:comment><comments>http://www.tkk7.com/aoneany/articles/239062.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/aoneany/comments/commentRss/239062.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/aoneany/services/trackbacks/239062.html</trackback:ping><description><![CDATA[<p>鑰佸鐨勪竴涓狝ctionscrit 鍦ㄧ嚎緙栬瘧鍣?a onmouseover="javascript:window.status='http://eval.hurlant.com/demo/'; return false;" title="(554 hits)" onmouseout="javascript:window.status=''; return false;" target="_blank">demo</a> <span id="zbpdttb" class="hitcounter">(554 hits)</span>,浠嶅湪寮鍙戦樁鏂?涓涓瘮杈冨疄鐢ㄧ殑涓滀笢.</p> <p><a >涓婚〉</a></p> <p><a >DEMO</a></p> <p><a >婧愮爜涓嬭澆</a></p> <img src ="http://www.tkk7.com/aoneany/aggbug/239062.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/aoneany/" target="_blank">娌欐紶涓殑楸?/a> 2008-11-06 16:53 <a href="http://www.tkk7.com/aoneany/articles/239062.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Flex瀛︿範涓績http://www.tkk7.com/aoneany/articles/238163.html娌欐紶涓殑楸?/dc:creator>娌欐紶涓殑楸?/author>Sun, 02 Nov 2008 05:05:00 GMThttp://www.tkk7.com/aoneany/articles/238163.htmlhttp://www.tkk7.com/aoneany/comments/238163.htmlhttp://www.tkk7.com/aoneany/articles/238163.html#Feedback0http://www.tkk7.com/aoneany/comments/commentRss/238163.htmlhttp://www.tkk7.com/aoneany/services/trackbacks/238163.htmlhttp://learn.adobe.com/wiki/display/Flex/Getting+Started

]]>
鍔犺澆鍜屽嵏杞芥ā鍨?/title><link>http://www.tkk7.com/aoneany/articles/237927.html</link><dc:creator>娌欐紶涓殑楸?/dc:creator><author>娌欐紶涓殑楸?/author><pubDate>Fri, 31 Oct 2008 16:46:00 GMT</pubDate><guid>http://www.tkk7.com/aoneany/articles/237927.html</guid><wfw:comment>http://www.tkk7.com/aoneany/comments/237927.html</wfw:comment><comments>http://www.tkk7.com/aoneany/articles/237927.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/aoneany/comments/commentRss/237927.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/aoneany/services/trackbacks/237927.html</trackback:ping><description><![CDATA[     鎽樿: There are several techniques you can use to load and unload modules in your Flex applications. These techniques include: ModuleLoader -- The ModuleLoader class provides the highest-level API fo...  <a href='http://www.tkk7.com/aoneany/articles/237927.html'>闃呰鍏ㄦ枃</a><img src ="http://www.tkk7.com/aoneany/aggbug/237927.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/aoneany/" target="_blank">娌欐紶涓殑楸?/a> 2008-11-01 00:46 <a href="http://www.tkk7.com/aoneany/articles/237927.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Syntax for embedding assets http://www.tkk7.com/aoneany/articles/237898.html娌欐紶涓殑楸?/dc:creator>娌欐紶涓殑楸?/author>Fri, 31 Oct 2008 13:15:00 GMThttp://www.tkk7.com/aoneany/articles/237898.htmlhttp://www.tkk7.com/aoneany/comments/237898.htmlhttp://www.tkk7.com/aoneany/articles/237898.html#Feedback0http://www.tkk7.com/aoneany/comments/commentRss/237898.htmlhttp://www.tkk7.com/aoneany/services/trackbacks/237898.htmlThe syntax that you use for embedding assets depends on where in your application you embed the asset. Flex supports the following syntaxes:

  • [Embed(parameter1, paramater2, ...)] metadata tag

    You use this syntax to embed an asset in an ActionScript file, or in an <mx:Script> block in an MXML file. For more information, see Using the [Embed] metadata tag.

  • @Embed(parameter1, paramater2, ...) directive

    You use this syntax in an MXML tag definition to embed an asset. For more information, see Using the @Embed() directive in MXML.

  • Embed(parameter1, paramater2, ...) directive

    You use this syntax in an <mx:Style> block in an MXML file to embed an asset. For more information, see Embedding assets in style sheets.

All three varieties of the embed syntax let you access the same assets; the only difference is where you use them in your application.

Escaping the @ character

You can use the slash character (\) to escape the at sign character (@) when you want to use a literal @ character. For example, the string "\@Embed(foo)" means the literal string "@Embed(foo)"). You use two slash characters (\\) to escape a single backslash character. For example, use the character string "\\@" to specify the literal strings "\@".

Embed parameters

Each form of the embed syntax takes one or more optional parameters. The exact syntax that you use to embed assets depends on where they are embedded. Some of these parameters are available regardless of what type of asset you are embedding, and others are specific to a particular type of media. For example, you can use the source and mimeType parameters with any type of media, but the scaleGridRight parameter applies only to images.

The following table describes the parameters that are available for any type of embedded asset. For more information, see About the source parameter and About the MIME type.

Parameter

Description

source

Specifies the name and path of the asset to embed; either an absolute path or a path relative to the file containing the embed statement. The embedded asset must be a locally stored asset. Therefore you cannot specify a URL for an asset to embed.

For more information on setting the path, see About setting the path to the embedded asset.

mimeType

Specifies the mime type of the asset.

The following table describes the parameters that are specific for images and Sprite objects. For more information, see Using 9-slice scaling with embedded images.

Parameter

Description

scaleGridTop

Specifies the distance in pixels of the upper dividing line from the top of the image in a 9-slice scaling formatting system. The distance is relative to the original, unscaled size of the image.

scaleGridBottom

Specifies the distance in pixels of the lower dividing line from the top of the image in a 9-slice scaling formatting system. The distance is relative to the original, unscaled size of the image.

scaleGridLeft

Specifies the distance in pixels of the left dividing line from the left side of the image in a 9-slice scaling formatting system. The distance is relative to the original, unscaled size of the image.

scaleGridRight

Specifies the distance in pixels of the right dividing line from the left side of the image in a 9-slice scaling formatting system. The distance is relative to the original, unscaled size of the image.

The following table describes the parameter that is specific to SWF files. For more information, see Embedding SWF files.

Parameter

Description

symbol

Specifies the symbol in a SWF file to embed, for use with Adobe Flash Player 8 and earlier.

About the source parameter

In almost all cases, you must specify the source parameter, or nothing is embedded.

The source parameter is the default parameter of the [Embed] metadata tag; therefore, if you are not specifying any other parameters, you can just supply its value without explicitly including the parameter name or assigning it the desired value, as the following example shows:

<mx:Style>    
    .myCustomButton {
        overSkin:Embed("overIconImage.gif");
        upSkin:Embed(source="upIconImage.gif");
        downSkin:Embed(source="downIconImage.gif");
    }
</mx:Style>

About setting the path to the embedded asset

You can specify a fully qualified path to the image or a URL, as the following examples show:

<mx:Button label="Icon Button" 
    icon
="@Embed(source='c:/myapp/assets/logo.gif')"/>
<mx:Button label="Icon Button" 
    icon
="@Embed(source='http://host.com/myapp/assets/logo.gif')"/>
Note: Do not use the backslash character (\) as a separator in the path.

 

If the path does not start with a slash character, Flex first searches for the file relative to the file that contains the [Embed] metadata tag. For example, the MXML file testEmbed.mxml includes the following code:

<mx:Button label="Icon Button" icon="@Embed(source='assets/logo.gif')"/>

In this example, Flex searches the subdirectory named assets in the directory that contains the testEmbed.mxml file. If the image is not found, Flex then searches for the image in the SWC files associated with the application.

If the path starts with a slash character, Flex first searches the directory of the MXML file for the asset, and then it searches the source path. You specify the source path to the Flex compiler by using the source-path compiler option. For example, you set the source-path option as the following code shows:

-source-path=a1,a2,a3

The MXML file a1/testEmbed.mxml then uses the following code:

<mx:Button label="Icon Button" icon="@Embed(source='/assets/logo.gif')"/>

Flex first searches for the file in a1/assets, then in a2/assets, and then in a3/assets. If the image is not found, Flex searches for the image in the SWC files associated with the application.

If the MXML file is in the a2 directory, as in a2/testEmbed.mxml, Flex first searches the a2 directory and then the directories specified by the source-path option.

About the MIME type

You can optionally specify a MIME type for the imported asset by using the mimeType parameter. If you do not specify a mimeType parameter, Flex makes a best guess about the type of the imported file based on the file extension. If you do specify it, the mimeType parameter overrides the default guess of the asset type.

Flex supports the following MIME types.

  • application/octet-stream
  • application/x-font
  • application/x-font-truetype
  • application/x-shockwave-flash
  • audio/mpeg
  • image/gif
  • image/jpeg
  • image/png
  • image/svg
  • image/svg-xml

Using the [Embed] metadata tag

You can use the [Embed] metadata tag to import JPEG, GIF, PNG, SVG, SWF, TTF, and MP3 files.

You must use the [Embed] metadata tag before a variable definition, where the variable is of type Class. The following example loads an image file, assigns it to the imgCls variable, and then uses that variable to set the value of the source property of an Image control:

<?xml version="1.0"?>
<!-- embed\ImageClass.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
    width
="100" height="80" borderStyle="solid">
    
    
<mx:Script>
        
<![CDATA[
            [Embed(source="logo.gif")]
            [Bindable]
            public var imgCls:Class;
        
]]>
    
</mx:Script>

    
<mx:Image source="{imgCls}"/>
</mx:Application>



]]>
鎵嬪姩瑙﹀彂浜嬩歡http://www.tkk7.com/aoneany/articles/237062.html娌欐紶涓殑楸?/dc:creator>娌欐紶涓殑楸?/author>Tue, 28 Oct 2008 03:57:00 GMThttp://www.tkk7.com/aoneany/articles/237062.htmlhttp://www.tkk7.com/aoneany/comments/237062.htmlhttp://www.tkk7.com/aoneany/articles/237062.html#Feedback0http://www.tkk7.com/aoneany/comments/commentRss/237062.htmlhttp://www.tkk7.com/aoneany/services/trackbacks/237062.htmlYou can manually dispatch events using a component instance's dispatchEvent() method. All components that extend UIComponent have this method. The method is inherited from the EventDispatcher class, which UIComponent extends.

The syntax for the dispatchEvent() method is as follows:

objectInstance.dispatchEvent(event:Event):Boolean

When dispatching an event, you must create a new Event object. The syntax for the Event object constructor is as follows:

Event(event_type:String, bubbles:Boolean, cancelable:Boolean)

The event_type parameter is the type property of the Event object. The bubbles and cancelable parameters are optional and both default to false. For information on bubbling and capturing, see Event propagation.

You can use the dispatchEvent() method to dispatch any event you want, not just a custom event. You can dispatch a Button control's click event, even though the user did not click a Button control, as in the following example:

<?xml version="1.0"?>
<!-- events/DispatchEventExample.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="createListener(event);">
    
<mx:Script><![CDATA[
        import mx.controls.Alert;
        private function createListener(e:Event):void {
            b1.addEventListener(MouseEvent.MOUSE_OVER, myEventHandler);
            b1.addEventListener(MouseEvent.CLICK, myClickHandler);
        }

        private function myEventHandler(e:Event):void {
            var result:Boolean = b1.dispatchEvent(new MouseEvent(MouseEvent.CLICK, true, false));           
        }

        private function myClickHandler(e:Event):void {
            Alert.show("The event dispatched by the MOUSE_OVER was of type '" + e.type + "'.");
        }
    
]]></mx:Script>

    
<mx:Button id="b1" label="Click Me"/>

</mx:Application>

 

You can also manually dispatch an event in an MXML tag. In the following example, moving the mouse pointer over the button triggers the button's click event:

 

<?xml version="1.0"?>
<!-- events/DispatchEventExampleInline.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="createListener(event);">
    
<mx:Script><![CDATA[
        import mx.controls.Alert;

        private function createListener(e:Event):void {
            b1.addEventListener(MouseEvent.CLICK, myClickHandler);
        }

        private function myClickHandler(e:Event):void {
            Alert.show("The event dispatched by the MOUSE_OVER was of type '" + e.type + "'.");
        }
    
]]></mx:Script>

    
<mx:Button id="b1" 
        label
="Click Me" 
        mouseOver
="b1.dispatchEvent(new MouseEvent(MouseEvent.CLICK, true, false));"
    
/>

</mx:Application>

 

杞澆:http://livedocs.adobe.com/flex/3/html/events_07.html#220526



]]>
FLEX 鏃ュ巻緇勪歡鍜屾簮浠g爜 http://www.tkk7.com/aoneany/articles/222225.html娌欐紶涓殑楸?/dc:creator>娌欐紶涓殑楸?/author>Fri, 15 Aug 2008 05:45:00 GMThttp://www.tkk7.com/aoneany/articles/222225.htmlhttp://www.tkk7.com/aoneany/comments/222225.htmlhttp://www.tkk7.com/aoneany/articles/222225.html#Feedback0http://www.tkk7.com/aoneany/comments/commentRss/222225.htmlhttp://www.tkk7.com/aoneany/services/trackbacks/222225.htmlFlex鏃ュ巻緇勪歡婧愮爜

婧愮爜涓嬭澆

婧愮爜涓嬭澆

婧愮爜涓嬭澆

 

杞澆:http://www.uncool.cn/blogs/read.php?238

]]>
主站蜘蛛池模板: 日韩一区二区在线免费观看| 亚洲avav天堂av在线不卡| 国产成人啪精品视频免费网| 国产精品亚洲αv天堂无码| 亚洲黑人嫩小videos| 免费人成动漫在线播放r18| 国产92成人精品视频免费| 国产啪亚洲国产精品无码| 国产午夜亚洲精品国产| 免费污视频在线观看| 波多野结衣中文一区二区免费 | 黄色三级三级免费看| 亚洲免费一级视频| 亚洲另类春色校园小说| 人妻免费一区二区三区最新| 免费一级毛片不卡在线播放| 免费视频成人国产精品网站 | 国产在线a不卡免费视频| 人妻无码中文字幕免费视频蜜桃 | 亚洲?V无码乱码国产精品| 国产精品亚洲午夜一区二区三区| 热99RE久久精品这里都是精品免费 | 亚洲AV无码码潮喷在线观看| 疯狂做受xxxx高潮视频免费| 成人啪精品视频免费网站| 亚洲网址在线观看| 久久国产乱子精品免费女| 亚洲视频免费一区| 日韩成人免费aa在线看| caoporn成人免费公开| 亚洲AV无码成人精品区大在线| jizzjizz亚洲日本少妇| 午夜免费福利在线观看| 在线亚洲午夜片AV大片| 伊人久久大香线蕉免费视频| 亚洲精品综合久久| 一级女性全黄生活片免费看| 亚洲区小说区图片区| 午夜精品一区二区三区免费视频| 亚洲福利视频导航| 国产麻豆免费观看91|