You don't have to give it a new instance name each time. Just have a default
one in the MXML with id='videoDisplay' (which will never be used btw) -
and then remove it and add a new one dynamically to the container each time
the user requests to watch a video.

The initial MXML one is just so that you can reference it in your code
without the IDE complaining.

Have one method which adds and one which removes the listeners (so you just
call those each time).

Yes, a bit hackish but it works :-)

Good luck.

- Bjørn




On 03/12/2007, Nadeem Manzoor <[EMAIL PROTECTED]> wrote:
>
>    Thanks bjorn
>
> Its hard to implement what you have suggested as i have created some
> states and there are alot of listener attached to videoDisplay. Do i need to
> change the instance name of the videoDisplay every time. ?
>
> I will give it a shot but i am still looking for a simple solution
>
> Thanks
>
>
>
>
> On 12/3/07, bjorn - <[EMAIL PROTECTED]> wrote:
> >
> >  I've actually had so much problems with this that I decided to replace
> > my VideoDisplay instance each time I load a video (and delete the old one).
> >
> > If you go this route it's important that you:
> > - remove all event listeners from it
> > - set .source = ""
> > - call .load() on the empty source
> >
> > .. before removing the instance .. or else it may start sending events
> > or continue loading in the background.
> >
> > - Bjørn
> >
> >
> >  On 03/12/2007, Nadeem Manzoor <[EMAIL PROTECTED] > wrote:
> > >
> > >    hello All
> > >
> > >
> > > I am in a big trouble, problem is i have developed a video player in
> > > flex. It works fine. But an incorrect URL is passed to the player , it
> > > troughs an error (connection Error) but after that it does not even load a
> > > correct flv. how can i solve this problem .. I know there must be a simple
> > > solution for that ..
> > >
> > > Can i verify a url before setting it to the source property of
> > > videoDisplay
> > >
> > > Thanks in Advance,
> > >
> > > --
> > > Regards,
> > >
> > > Nadeem Manzoor
> > >
> > >
> >
> >
> > --
> >
> > ========================
> > http://www.juicability.com - flex blog
> > http://www.43min.com - funny movies
> >
>
>
>
> --
> Regards,
>
> Nadeem Manzoor
>
> 
>



-- 

========================
http://www.juicability.com - flex blog
http://www.43min.com - funny movies

Reply via email to