Skip to main content
Participating Frequently
November 3, 2008
Question

FLVPlayback changing another FLVPlayback

  • November 3, 2008
  • 2 replies
  • 448 views
Hi,

I have a movieclip with an FLVPlayback component and a second movieclip on it. In that second movie clip, there's another FLVPlayback component. I was wondering if there was any actionscript I could use in the second movieclip to change the contentPath of the first FLVPlayback component upon the completion of the second FLVPlayback component.

This is the code I tried, but didn't work:

var listenerObject:Object = new Object();
listenerObject.complete = function(eventObject:Object):Void {
this._parent.flvp1.contentPath = "vid2.flv";
}
flvp2.addEventListener("complete", listenerObject);

(flvp1 is the first FLVPlayback component, flvp2 is the second, and vid2.flv is the file to be played in flvp1)

Also, I know that the listenerObject function is working because I tested a trace() command earlier, and it worked.

If anyone could point me in the right direction, I would appreciate it.

Thanks,
Brad
This topic has been closed for replies.

2 replies

kglad
Community Expert
Community Expert
November 3, 2008
that's ok.

to find the path between two timelines you can always attach the following to each timeline:

trace(this);
kglad
Community Expert
Community Expert
November 3, 2008
"this" is going to reference your listenerObject and not a timeline: fix the path to flvp1.
Participating Frequently
November 3, 2008
Thanks kglad,

I think that's where I'm having a problem. I'm unsure of the path to flvp1. Would I change it to:

_root._parent.flvp1.contentPath = "vid2.flv"; ?

Thanks again,
Brad
Participating Frequently
November 3, 2008
Also,

Could you recommend a website or book that explains how the hierarchy of movieclips, functions, components, etc. works? That's where I seem to run into most of my problems when communicating between movieclips.

Thanks,
Brad