Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
ADOBE FLASH: HomeFlash ForumFlash TutorialsFlash Video TutorialsWeb Streaming ForumAdobe FlashPodcast

Re: NetConnection Question

Cow Forums : Adobe Flash
VIEW POSTS   •   ADD A NEW POST   •   SEARCH   •   CHANGE FORUM
Respond to this post   •   Return to posts index   •   Read entire thread


Re: NetConnection Question
by Amy Lee Walton on Jan 11, 2009 at 5:26:20 am

Hi there,

Null is the value you always use unless you're using a Flash Media Server, has nothing to do with the button.

On the stage, just have your button and have it named appropriately... mine is playBtn. In this code I basically open the net connection, put in a netstream, set the client to stage, plug in the flv, attach it to a video object, then to stage, then pause it and add an event that detects when the button is click and plays the movie. you may want to add a still image of the movie to represent it and make that the button or something cool like that. either way the below code should work.

Good luck!
Amy Lee


-----------------

var nc:NetConnection = new NetConnection();
nc.connect(null);

var ns:NetStream = new NetStream(nc);
ns.client = this;
ns.play("videos/yourvideoname.flv");

var vid:Video = new Video();
vid.attachNetStream(ns);
addChild(vid);
vid.x = 110;
vid.y = 90;

playBtn.addEventListener(MouseEvent.CLICK, playHandler);
ns.pause();

function playHandler(e:MouseEvent):void {
ns.resume();
}



Respond to this post   •   Return to posts index   •   Read entire thread


Current Message Thread:


Related Threads:
NetConnection issues...   |   can the netConnection....



Note: If you are a registered user please click here to login before posting.

Your post will not be accepted if your name and email address are not registered in our database. Click here if you do not have an account.

Name
E-Mail Address
Subject
E-Mail me when someone responds
Just This Message   Entire Thread   None  

Message:



Note: The following are HTML characters and may cause parts of your post to disappear if not used correctly: < > &
To include any portion of the post in your response, highlight the desired text and hit the "Q" key. Read more...



Add your message signature


 


Note: By clicking "Post Direct" button above, you are agreeing to the Creative Cow's Code of Conduct.



FORUMSTUTORIALSMAGAZINETRAININGVIDEOS - REELSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]