PDA

View Full Version : Path Issue?


hothousegraphix
07-25-2006, 05:37 PM
I've inherited a project that I've had to make changes to. One of which is now preventing a section of this project from functioning properly.

I have a swf that I'm now loading into a container clip on my main timeline via:loadMovie ("lecordon_bleu_part7.swf", "_level0.ContainerMC");
// this work just fine
However, contained in the movie being loaded is a script that targets a comboList which loads streaming video that now no longer functions when loaded into the containerMC. It does work fine when simply testing the swf without loading it.

Below is the function in question, I'm not sure when I need to adjust the script to have the paths targeted correctly:
comboList.addEventListener("change", this);
//trace(comboList);
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
_videoPlayer.attachVideo(stream_ns);
function change (e:Object) {
//trace("called");
//trace(e.target.selectedItem.data);
stream_ns.play("videos/" + e.target.selectedItem.data);
}
stop();
Any advice would be Appreciated !

Thanks.

CyanBlue
07-25-2006, 05:48 PM
Howdy and Welcome... :)

I assume that comboList is an instance of the ComboBox component... Your main FLA should have the same component in the library to be able to load the SWF that contains the component...
Try to drag the same component into the stage and remove it so that it will be only residing in the library...

hothousegraphix
07-25-2006, 07:17 PM
Hey, thanks for the reply.

I have to say I haven't relly used components - forgive my lack of experience.
I assume that comboList is an instance of the ComboBox component
YES! You are correct.

I've gone ahead and dropped an instance of the comboBox in my main movie and the results are mixed.

Had to update the path of the video player obviously. This functionality in now work correctly, but, with the addition of the comboBox to my Library, for some reason, my off stage buttons which target keyboad commands now Do Not function???

Not sure why this is but I've narrowed it down to the adition of the comboBox to my Library because when I remove it from the Library, I regain that the ability to exicute my actions from my keyboard.

The script I'm using to exicute my actions is as follows:
// Placed on a button instance located off stage
on(keyPress "<Right>"){
_level0.gotoAndStop(9);
}

:confused:

Got any advise?

tcox
07-25-2006, 07:24 PM
I had a similar problem to this a while ago and was informed by a member of this forum that components automatically take the highest available depth of root, so calls to _root.getNextHighestDepth after components have been introduced to the stage return problematic layers.

My problem was that I could draw to the depths returned but not removeMovie from them. I'd guess that your problem is similar? If it is, the solution would be to keep your buttons in a clip off the root timeline.

Then again, I might be completely off :)

hothousegraphix
07-25-2006, 08:36 PM
I've tried two different solutions. I've placed my buttons on both my root timeline and within the clips being loaded into my main timeline. Each does not work.

Not sure where to go from here?

Is there a general keyboard command to "Stop" ad swf playing within FLASH PLAYER?
i.e.
Ctrl+Enter = Play
Ctrl+> = Forward
Ctrl+< = ReWind
Stop=??????

tcox
07-25-2006, 09:26 PM
perhaps just changing the way you listen to the keyboard would help

maybe do something like this:


var listener = [];
Key.addListener(listener);
listener.onKeyDown = function() {
switch(Key.getCode()) {
case Key.RIGHT:
// do "right" action
break;
case Key.LEFT:
// do "left" action
break;
case Key.SPACE:
// do "space" action
break;
}
}


It's fairly simple and my (limited) test of introducing a combo box after the fact didn't break it. It doesn't explain your button failure but it might sidestep the issue.

As for other keys, the Key class has many common ones defined as constants. Think all the codes are simply ascii however.