PDA

View Full Version : FLVPlayback in externally loaded .swf in sub directory


RandyS
06-28-2007, 02:54 PM
Greetings all,

I'm having an FLVPlayback issue. I have a main.swf file that load slides in a subdirectory. Some slides have video and some have audio. Like this.

projectdirectory/main.swf
projectdirectory/slides/slide_01.swf
projectdirectory/slides/video_01.flv

When I author and test slide_01.swf the FLVPlayback component works flawlessly. Its set to autoplay.

When I run main.swf and load slide_01.swf then video_01.flv does not play and I get an error 1000 can't connect to server.

Is this a path issue? If the FLVPlayback component is in the timeline of slide_01.swf and links simply to video_01.flv, does that get broken somehow when main.swf loads it from one directory above?

TIA,
RandyS

PainBehindMyEye
06-28-2007, 08:01 PM
Your actionscript and component required for the FLVPlayback needs to be in that slide swf and the path would likely need to be relative to the main swf's location (?)

Seeing how you initiate and load would help.

- PBME

RandyS
06-28-2007, 09:24 PM
Hi, thanks for your reply.

projectdirectory/main.swf
projectdirectory/slides/slide_01.swf
projectdirectory/slides/video_01.flv

// slide_01.swf contains FLVPlayback component
// contentpath set to "video_01.flv"
// this works if I call it on its own during testing (ctrl-enter)

// script in main.swf
// in main timeline I call ... LoadSlide("slide_01.swf")

// and this function loads the external clip
// it works as it does load "slide_01" but the video doesn't play.
// if I put video_01.flv in same directory as main.swf it works
// but for organization purposes I want the media resources in sub directories
// (its a CD project).

// Maybe something is wrong with my path name concatenation?

function LoadSlide(pFileName) {

// sub directory "slides"
var tFilePath = "slides/" + pFileName;
trace("LoadSlide " + pFileName +" "+ tFilePath);
var _mcl:MovieClipLoader = new MovieClipLoader();
var _listener:Object = new Object();
_listener.onLoadInit = function(_slideClip:MovieClip) {
trace("Done loading...");
};
_mcl.addListener(_listener);
this.createEmptyMovieClip("_slideClip", this.getNextHighestDepth());
_mcl.loadClip(tFilePath, _slideClip);
}

TIA,
RandyS

RandyS
06-29-2007, 09:14 AM
projectdirectory/main.swf
projectdirectory/slides/slide_01.swf << has FLVPlayback component
projectdirectory/slides/video_01.flv

Well I kind of answered my own question.

Ideally I wanted to be able to build and test individual slides .swf files as I went along. Then have one main file load them as needed. Plus I wanted to keep the slides_xx.swf files in sub directory.

When I set the contentPath to "video_01.flv" it works but not when loaded from main.swf, one directory above.

If I set the contentPath to /slides/video_01.flv the component itself will complain that it can't find the file. Save it anyway and load from main.swf and it works.

It just seems that I can't have it both ways. There's gotta be a way though.

Cheers,
RandyS