Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

How to load local FLV file into a movieclip?

Avatar of abb1
abb1 asked on
Adobe Flash
4 Comments1 Solution849 ViewsLast Modified:
How to load local FLV file into a movieclip? I've found the next code but don't know what to do with it.
---------------------><8-------------------------
// CREATE VIDEO CONNECTION TO LOCAL MACHINE
// Set the name of the movie to be played
 fileName = "Intro.flv";
// Create a NetConnection object:
 var netConn:NetConnection = new NetConnection();
// Create a local streaming connection:
 netConn.connect(null);
// Create a NetStream object
 var netStream:NetStream = new NetStream(netConn);
// Define an onStatus() function:
 netStream.onStatus = function(infoObject) {
  status.text += "Status (NetStream)" + newline;
  status.text += "Level: " + infoObject.level + newline;
  status.text += "Code: " + infoObject.code + newline;
  // Turn on the mouse listener if the movie clip has ended.
  // This is how we are restarting the movie.
  if(infoObject.code == "NetStream.Buffer.Empty"){
   mouseListener = new Object();
   mouseListener.onMouseMove = function(){
    trace('play again');
    // TURN OFF THE MOUSE LISTENER
    Mouse.removeListener(mouseListener);
    // Clear status window
    status.text = "";
    // Replay the video
    playExternalVideo(fileName);
   }; Mouse.addListener(mouseListener);
  }
 };
 function playExternalVideo(fn){
 // Attach the NetStream video feed to the Video object:
  this.my_video.attachVideo(netStream);
  // Set the buffer time (seconds):
  netStream.setBufferTime(5);
  // Begin playing the FLV file: on frame 3 not here.
  netStream.play("media/video/"+fn);
 }
 playExternalVideo(fileName);
---------------------><8-------------------------

I've tried to place it into the movieclip's onLoad() event but with no luck.
Could anybody give me a working FLA or at least actionscript code with accurate instructions what and how to do?

Thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of SandyCooke
SandyCooke

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answers