dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: onData event handler not working

Hybrid View

  1. #1
    Member
    Join Date
    Nov 2000
    Posts
    55
    Strange thing here.

    Ok,look at that:

    mc.loadMovie("foo.swf|");
    mc.onData = function () {
    trace("!!!");
    }

    The result?
    The foo.swf load into mc, but nothing with the onData handler!!! Yes, there are data loaded, foo.swf is 1Mo, and I have a preloader, so I'm sure there are data loaded.

    Why?

    Other strange thing:
    If I put the event handler in a frame (like good old version 5) it's work. But if I put a variable, say "bar" into it, I can't initiate the value outside! Say:
    mc.bar = "foo";
    mc.loadMovie("foo.swf");
    and in the frame:
    onClipEvent() {
    trace("!!!") // that's work
    trace(this.bar) // undefined.
    }


    Why??

    Tnx a lot!!
    Flash and VooDoo is same thing.

  2. #2
    HELP>>>ACTIONSCRIPT DICTIONARY
    Join Date
    Feb 2000
    Location
    In the Present Moment
    Posts
    1,041

    Is this cutnpaste from Flash?

    mc.bar = "foo";
    mc.loadMovie("foo.swf");
    and in the frame:
    onClipEvent() {
    trace("!!!") // that's work
    trace(this.bar) // undefined.
    }
    If so the onClipEvent(?whichEvent?) is first of all not defined, second of all what do you mean "in the Frame"? On ClipEvents don't go in frames, they reside =on= movieClip objects.

    I'm not sure about the onData = function part. I have had limited success with the use of that particular feature so I am unable, at this time, to comment directly on it.

    Let me know how it goes.


  3. #3
    Senior Member
    Join Date
    Mar 2002
    Posts
    298
    This is a known problem, have a look at this article, it gives a pretty good explanation:

    http://www.flashguru.co.uk/000053.php

  4. #4
    HELP>>>ACTIONSCRIPT DICTIONARY
    Join Date
    Feb 2000
    Location
    In the Present Moment
    Posts
    1,041
    Ahhh, thanks for the link C4_Tom, that clears up a little of my confusion.

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