04-01-2008, 01:29 PM
|
#1
|
|
Registered User
Join Date: Jan 2007
Posts: 19
|
Problems with flv contentPath
I'm having problems with an FLV content path.
The video works fine if I just bung an FLVPlayback component onto the stage and play it:
myFLVplayer.contentPath = "video1.flv";
But I want to do clever things with actionscript. So I've created a myPlayer movie and dropped the FLVPlayback into there. However...
_root.myPlayer.myFLVplayer.contentPath = "video1.flv";
doesn't work.
I've checked and double-checked my paths -
_root.myPlayer.myFLVplayer._visible = false;
makes the player but not the movie disappear as expected. I just can't get the video to play when I add the FLVPlayback inside a movie clip rather than dragging it onto the stage when I create the .fla
Any help appreciated - thanks!
|
|
|
04-01-2008, 01:35 PM
|
#2
|
|
Banned by AS.org Staff
Join Date: Jan 2007
Location: Montréal, Québec
Posts: 14,073
|
Attach your .fla.
|
|
|
04-01-2008, 01:42 PM
|
#3
|
|
Super Moderator
Join Date: Dec 2006
Location: Amish Country, PA
Posts: 8,570
|
is 'myPlayer' the name of your movieclip symbol.. or did you accually assign the instance on the stage an instance name of 'myPlayer'..
and also.. .is the actionscript on the same frame # as where the myPlayer is on the stage?
__________________
Always optimizing...
|
|
|
04-01-2008, 01:58 PM
|
#4
|
|
Banned by AS.org Staff
Join Date: Jan 2007
Location: Montréal, Québec
Posts: 14,073
|
All questions (and many more to possibly come after these ones...) that would be easily answered, by attaching a .fla!
|
|
|
04-01-2008, 02:15 PM
|
#5
|
|
Registered User
Join Date: Jan 2007
Posts: 19
|
Ok - my .fla has over 500 lines of actionscript - so I've trimmed a little. These two files show the problem - one has the FLVPlayback on the stage - and works on my machine. The other has it embeded in a movie clip, and doesn't.
(I've not included the movie).
Thanks!
|
|
|
04-01-2008, 04:58 PM
|
#6
|
|
Banned by AS.org Staff
Join Date: Jan 2007
Location: Montréal, Québec
Posts: 14,073
|
There's a lag when attaching a mc and setting your player's content...
If you use 2 frames, this works...
1st frame:
var video:String = "video1.flv";
_root.attachMovie("video_mc", "myPlayer", 100, {_x:450, _y:90});
_root.myPlayer.myFLVplayer.contentPath = video;
Second frame:
stop();
_root.myPlayer.myFLVplayer.play(video);
|
|
|
04-02-2008, 01:49 PM
|
#7
|
|
Registered User
Join Date: Jan 2007
Posts: 19
|
Thanks - I will try.
Going off on a tangent slightly - I tend to create my flash movies by doing as much as I can through actionscript. Where possible, I have nothing at all on the stage, and one loooooong chunk of actionscript in layer one frame one.
This is probably because I have more of a programming head than a design head - it's also because I've recieved flash files from other flash designers that have half a dozen lines of actionscript buried here and there all over the place, and are virtually impossible to edit, even with documentation.
However, I've no idea whether this is good practice. The idea of having to start putting code in a second frame makes me nervous.
Any ideas. Any hints on good tutorials on how to structure a movie in the optimum way?
Cheers!
|
|
|
04-02-2008, 01:57 PM
|
#8
|
|
Banned by AS.org Staff
Join Date: Jan 2007
Location: Montréal, Québec
Posts: 14,073
|
Well, if you insist on doing it on one frame, you can always do this...
ActionScript Code:
var video:String = "video1.flv";
_root.attachMovie("video_mc", "myPlayer", 100, {_x:450, _y:90});
this.onEnterFrame = function(){
_root.myPlayer.myFLVplayer.contentPath = video;
delete this.onEnterFrame;
};
stop();
|
|
|
| Thread Tools |
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 11:08 PM.
///
|
|