Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Extensions and Plugins > Components

Reply
 
Thread Tools Rate Thread Display Modes
Old 10-25-2006, 06:58 PM   #1
Peran
Registered User
 
Join Date: Sep 2006
Posts: 53
Default Launching .FLV's entirely from AS (music video project)

Hi again guys!

Sorry to bother you with what's probably another easy-peasy question, but I'm a beginner at Flash and AS, and asking stupid questions is what we beginners do...

I'm doing a sort of relatively simple music video, with animations and stuff synced to an audio file.

First, I went thru my audio file, placing markers where I have points in time I want to sync stuff up to, I then export that to a text file, so I have exact min:sec:frame data that I can use later.

Next, I've done some animations in Flash and exported them to .AVI's using the brilliant FlashAnts tool (Flash is nowhere near being able to animate those 3D thingies in realtime). Then I've been toying around with using video editing software to put it all together, but it's just so messy compared to if I could do it all inside Flash.

So... I've converted the .AVI's into FLV's. and now I'd like to know a way to handle them sort of like I'd handle a movieclip, moving them around, stopping/resuming, changing blend modes and alpha.

First of all, is that possible?

I mean sure, I can just set up a _root.onEnterFrame = function() and have a framecounter ticking with if statements and all the usual hoopla to let the code know when to do stuff, but can I actually have that sort of control over a .FLV?


Thanks in advance,

Peran.
Peran is offline   Reply With Quote
Old 10-25-2006, 07:06 PM   #2
squadjot
Senior Member
 
Join Date: Nov 2003
Posts: 362
Default

if you load FLV's by using netstream, you usually control your movie with seek(second) ..so..its actually a totally other way than normally movieclip handling..

All the other things ..well you could load your video into a movieclip that you then set all these blend functions on and stuff..

i tried following the help file.. wasnt so hard.

Example taken from help file;

The following example plays a previously recorded file named myVideo.flv that is stored in the same directory as the SWF file.

var my_video:Video; // my_video is a Video object on the Stage
var my_nc:NetConnection = new NetConnection();
my_nc.connect(null);
var my_ns:NetStream = new NetStream(my_nc);
my_video.attachVideo(my_ns);
my_ns.play("video1.flv");
squadjot is offline   Reply With Quote
Old 10-25-2006, 08:02 PM   #3
Peran
Registered User
 
Join Date: Sep 2006
Posts: 53
Default

Quote:
Originally Posted by squadjot
All the other things ..well you could load your video into a movieclip that you then set all these blend functions on and stuff..
Thanks for the reply!

Now, the above code on it's own doesn't result in anything visible when I just paste it into a blank project (I point the filename to a .FLV in the correct dir). How would I go about to put that video into a movieclip?

Here's how my template .FLA starts out:

Code:
var mcMyStage=_root.createEmptyMovieClip("MyStage",1);
I'm not at all sure how to connect the video object as a child to the above movieclip. (I'm guessing that's what I should do to put the video inside the movieclip?)

The code below just throws a syntax error (but hey, at least I tried ) :

Code:
var mcMyStage=_root.createEmptyMovieClip("MyStage",1);
var mcMyStage.my_video:Video;
Like I said, I'm a beginner, please have patience.


Peran.
Peran is offline   Reply With Quote
Old 10-25-2006, 08:30 PM   #4
squadjot
Senior Member
 
Join Date: Nov 2003
Posts: 362
Default

Oops.i'm sorry...the netstream apparently only works for files that are online..

If your application doesent have to be super dynamic in the adpect of adding new videos.. you could more easily control the video if u simply import the flv's to the stage..and create SWF's containing the video.. then load those.
squadjot is offline   Reply With Quote
Old 10-25-2006, 08:41 PM   #5
Kraken
Flash beneath the fathoms
 
Join Date: Apr 2001
Location: Kansas City
Posts: 678
Default

the one piece you're missing is having a video object on the stage. First, go do your library and click on the little box in the upper-right corner. Choose New Video... from the dropdown menu. This will add a video object to your library. Now drag that video object to the stage and give it a name. From there, you can use netStream and netConnection like squadjot posted.

Look up the video class in the dictionary.
__________________
The coolest website ever!
Visit my friend Ray's site.
Kraken is offline   Reply With Quote
Old 10-26-2006, 06:27 AM   #6
Peran
Registered User
 
Join Date: Sep 2006
Posts: 53
Default

Hi again guys!

Thanks for your replies. I'm starting out with the "embed into .SWF" solution.

I created an empty .FLA, embedded the .FLV into it, and whoopee, a .SWF file that plays my video. Now, with a new empty .FLA, I've loaded that .SWF into my library, and given it an identifier, "BlurCircle". Next, I AS as follows:

Code:
var mcBlurCircle=_root.attachMovie("BlurCircle","instBlurCircle",1)
mcBlurCircle.gotoAndPlay(1);
...but nothing happens. Went thru a bit of the documentation and a couple of threads here on the forum, I get the impression the above code should work. Tried adding blank frames to the timeline, did nothing, tried creating mcBlurCircle with createEmptyMovieClip before attaching the movie, but neither of those made a difference.

I'm sure there's something really basic I'm missing, please slap my fingers and tell me where I went wrong.


Peran.
Peran is offline   Reply With Quote
Old 10-26-2006, 07:52 AM   #7
squadjot
Senior Member
 
Join Date: Nov 2003
Posts: 362
Default

i beleive its just _root.attachMovie("BlurCircle","instBlurCircle",1) ;
squadjot is offline   Reply With Quote
Old 10-26-2006, 08:03 AM   #8
squadjot
Senior Member
 
Join Date: Nov 2003
Posts: 362
Default

Quote:
Originally Posted by Kraken
the one piece you're missing is having a video object on the stage. First, go do your library and click on the little box in the upper-right corner. Choose New Video... from the dropdown menu. This will add a video object to your library. Now drag that video object to the stage and give it a name. From there, you can use netStream and netConnection like squadjot posted.

Look up the video class in the dictionary.
i'm pretty sure netstream wont work with local files..
squadjot is offline   Reply With Quote
Old 10-26-2006, 08:11 AM   #9
Peran
Registered User
 
Join Date: Sep 2006
Posts: 53
Default

Maybe there's another problem... When I try to preview my .SWF (which contains the .FLV) inside the library, it's just blank. Also, the .FLA file containing the .SWF is a bit smaller (61kb) than the .SWF itself (140kb).

I'm guessing that could be the problem. Question is, what to do about it?

If I double-click the .SWF file from Windows, it plays nicely in the Flash Player.

To get it into the library, I do File -> Import -> Import to Library, then set the Identifier to "BlurCircle", leave Class blank.

So... Should a .SWF preview animated in the library, and is the filesize problem as bad as I suspect (i e Flash simply screws up horribly when I import the .SWF)?

I've attached my .FLA and the .SWF containing the .FLV (totals 149kb).


Peran.
Attached Files
File Type: zip videotest003.zip (148.1 KB, 96 views)
Peran is offline   Reply With Quote
Old 10-26-2006, 12:00 PM   #10
Peran
Registered User
 
Join Date: Sep 2006
Posts: 53
Default

Hi again!

Been doing some more testing here...

If I replace the .SWF containing a .FLV with a .SWF with just a simple tween done in the timeline, all's well with the code below:

Code:
var mcBlurCircle=_root.attachMovie("BlurCircle","instBlurCircle",1)
mcBlurCircle.gotoAndPlay(1);
...that .SWF also previews just fine from within the Library.

So, for some reason Flash screws up (an expletive beginning with "f" would be more suitable, but who knows, kids might read this too) when I import a .SWF made from a .FLV to the Library. I can't preview the .SWF in the Library, and the above code doesn't play it.

Can anyone else confirm this behavior? To me, it's looking like a raging bug.


Peran.
Peran is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Some Flash Video Converter Tools Compare terry117 Detention 7 05-18-2006 02:08 AM
best way for loading video into a project Mr.Tufnel Other Flash General Questions 1 01-25-2006 03:36 AM
Tricky issue with a juke box (video and music) sincustoms ActionScript 1.0 (and below) 1 06-06-2005 03:11 AM
How to stop bckgrd music for video section project-09 ActionScript 1.0 (and below) 4 10-01-2004 06:31 AM


All times are GMT. The time now is 11:54 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.