Hi all....
I want to display using one repeater some images....that i get from the
database. I´m using Cairngorm for my applicaiton...but i think this
is not my problem
I´m getting one error...maybe because my unknowledge in Flex....and
is related with the events
Here is my source :
<mx:repeater id="grdMovies" width="100%" height="100%"
horizontalCenter="0" bottom="0">
<detail:detailMovie id="detailmovie" myMovie="{grdMovies.currentItem}"/>
<mx:HRule width="100%"/>
</mx:repeater>
As you can see inside the repeater i have one component
detail:detailMovie
Here is the source of the detailMovie component:
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="548"
height="142"
backgroundColor="#FFFFFF" backgroundAlpha="0.0"
creationComplete="loadData();">
<mx:Script>
<![CDATA[
import com.cairngorm.vo.Movie;
import com.cairngorm.events.movieimage.repeater.GetCoverRepeaterEvent;
[Bindable]
public var myMovie:Movie;
public function loadData():void
{......}
public function showCover():void
{
var getCoverRepeaterEvent:GetCoverRepeaterEvent = new
GetCoverRepeaterEvent(this.myMovie.movieId);
getCoverRepeaterEvent.dispatch();
}
public function loaderCompleteHandler(event:Event):void
{
this.movie_cover.source = event.currentTarget.content as Bitmap;
}
]]>
</mx:Script>
<mx:Image x="13" y="27" width="125" height="106" id="movie_cover"
creationComplete="showCover();" toolTip="{myMovie.synopsis}"/>
......... more data
</mx:Canvas>
When i call the creationComplete of the image, it will access to the
database and get the image....untill here all the things are
succesfull....but the problem is when i try to display the image....
i use other function :
public function displayImageRepeater():void {
if (this.movieCoverRepeater != null && this.movieCoverRepeater.length >
0)
{
var loader:Loader = new Loader();
loader.loadBytes(this.movieCoverRepeater);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
Application.application.repeatermovies.detailmovie.loaderCompleteHandler\
);
}
}
In the object movieCoverRepeater i have the image loaded (ByteArray).
But the problem is when i try to call the addEventListener of the
loader.... i always get one error.
TypeError: Error #2007: El valor del parámetro listener debe ser
distinto de null.
at flash.events::EventDispatcher/addEventListener()
sorry the error is in Spanish....in english is like : The listener
parameter value can not be null.
In the source i show you...i have taken out some source...because is not
interesting...and i know is working succesfully.
Reading the error, i can see is something with the event....but honestly
i don´t know why the error....
I hope someone can help me....Thanks in advance