| <?xml version="1.0" encoding="utf-8"?> |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| |
| --> |
| <s:VGroup xmlns:fx="http://ns.adobe.com/mxml/2009" |
| xmlns:s="library://ns.adobe.com/flex/spark" |
| xmlns:mx="library://ns.adobe.com/flex/mx"> |
| |
| <fx:Script> |
| <![CDATA[ |
| import mx.events.ResizeEvent; |
| |
| protected function img_completeHandler(evt:Event):void { |
| debug.appendText(evt.type + "_"); |
| } |
| |
| protected function img_httpStatusHandler(evt:HTTPStatusEvent):void |
| { |
| debug.appendText(evt.type + "_" + evt.status + "_"); |
| } |
| |
| |
| protected function img_ioErrorHandler(evt:IOErrorEvent):void |
| { |
| debug.appendText(evt.type + "_" ); |
| } |
| |
| |
| protected function img_progressHandler(evt:ProgressEvent):void |
| { |
| // Only append first and last progress message. Depending on load time there |
| // can be differing number of progress messages and it wouldn't possible to |
| // do an AssertPropertyValue on debug.text and have it always pass. |
| if (evt.bytesLoaded==0 || evt.bytesLoaded == evt.bytesTotal) |
| debug.appendText(evt.type + " " + evt.bytesLoaded + " of " + evt.bytesTotal ); |
| } |
| |
| |
| protected function img_resizeHandler(evt:ResizeEvent):void |
| { |
| debug.appendText(evt.type); |
| } |
| |
| ]]> |
| </fx:Script> |
| |
| <s:Image id="img" |
| complete="img_completeHandler(event);" |
| httpStatus="img_httpStatusHandler(event);" |
| ioError="img_ioErrorHandler(event);" |
| resize="img_resizeHandler(event);" |
| progress="img_progressHandler(event);" /> |
| |
| <s:BitmapImage id="bi" |
| complete="img_completeHandler(event);" |
| httpStatus="img_httpStatusHandler(event);" |
| ioError="img_ioErrorHandler(event);" |
| progress="img_progressHandler(event);" /> |
| <s:TextArea id="debug" editable="false" /> |
| |
| </s:VGroup> |
| |