A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: not working in embeded movie

  1. #1
    Member
    Join Date
    Aug 2003
    Posts
    43

    not working in embeded movie

    this works fine when playing in a standalone swf, but when loaded as a module into another movie, it does not work at all. Any ideas?



    this.nc = new NetConnection();
    this.nc.connect("rtmp:/cinema/video");
    this.NewStream = new NetStream(this.nc);
    MyVideo.attachVideo(this.NewStream);
    this.NewStream.play("movieToPlay");

    this.NewStream.onStatus = function(returnObj) {

    this.coolMovie.gotoAndStop(2);

    }


    Please help, my boss is freaking out because the company movie is stuck saying "buffering" while it should say "playing"...

    thanks for any help.

  2. #2
    psx = new Moderator();
    Join Date
    Jan 2001
    Posts
    923
    Did you try it like so:

    this.nc = new NetConnection();
    this.nc.connect("rtmp:/cinema/video");
    this.NewStream = new NetStream(this.nc);
    MyVideo.attachVideo(this.NewStream);
    this.NewStream.play("movieToPlay");

    this.NewStream.onStatus = function(returnObj) {
    // removed "this"
    coolMovie.gotoAndStop(2);

    }


    What's happening is that inside the onStatus, "this" refers to the netStream, and not the movie clip where the code is. Taking out "this" makes it jump outside the netStream scope to look for the coolMovie.

    psx

  3. #3
    Member
    Join Date
    Aug 2003
    Posts
    43
    thanks psychlonex.

    Actually I already figured it out, and you are correct. Actually, I think what you mentioned will work just fine, but I found that it also works without using "this" anywhere.

    but yes, that was exactly the problem. I removed "this" from "this.coolMovie.gotoAndStop(2);", and it worked fine. It used to be "_root" as a standalone, and when I added it as a module, I thought the logical thing to do is add a path that fits. BAH! Flash makes me lose so much sleep sometimes...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center