YouTube code
The following is my YouTube code, its vertbatem from the book. I get this error message:
Severity and Description Path Resource Location Creation Time Id
1046: Type was not found or was not a compile-time constant: ResultEvent. Chapter 6 youtubeexamp.mxml line 17 1191720037113 352
It is referencing:
public function handleResult(event:ResultEvent):void
here it is:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:local="*"
creationComplete="src.sec()">
<mx:Script>
<![CDATA[
import mx.rpc.ecents.ResultEvent;
import mx.utils.ArrayUtil;
import mx.collections.ArrayCollection;
import mx.utils.ObjectUtil;
[Bindable]
public var videos:ArrayCollection;
public function handleResult(event:ResultEvent):void
{
videos = event.result.ut_response.video_list.video;
}
]]>
</mx:Script>
<mx:HTTPService id="srv" url="http://www.youtube.com/api2_rest?method=youtube.videos.list_feature&d ev_id=x01oc-ASJRM"
useProxy="false"
result="handleResult(event)" />
<mx:List width="500" height="500" dataProvider="{videos}">
<mx:itemRenderer>
<mx:Component>
<mx:HBox height="105" verticalAlign="middle" verticalScrollPolicy="off" horizontalScrollPolicy="off">
<mx:Image source="{data.thumbnail_url}" />
<mx:VBox width="100" height="100" verticalScrollPolicy="off" horizontalScrollPolicy="off">
<mx:Label text="{data.title}" fontFamily="Arial" fontSize="12" fontWeight="bold" />
<mx:Text text="{data.description}" width="100%" />
</mx:VBox>
</mx:HBox>
</mx:Component>
</mx:itemRenderer>
</mx:List>
</mx:Application>
|