So, I've been banging my head against two different issues that turned out to have the same root cause: problems setting the volume of a loaded movieclip, and problems getting a custom class to initialize. After a few days of frustration, I stripped the LFC down to only include the files I'm working with and decompiled them. Here's what I found:

This source:

    var s = new Sound(t);

Compiles to this:

    var v1 = Sound.make(t);

Since Sound is a built-in object, it doesn't have a make() method.

Here's another one:

    HelloWorld = function (){
        alert('say hello!')
    }

    HelloWorld.sayHello = function(msg){
        return "FLASH: Message received from JavaScript was: " + msg;
    }

    helloWorld = new HelloWorld();


Compiles to:

    with (_root) {
    }
    HelloWorld = function () {
        alert('say hello!')
    };

    with (_root) {
    }
    HelloWorld.sayHello = function (msg) {
        return 'FLASH: Message received from JavaScript was: ' + msg;
    };

    helloWorld = HelloWorld.make();


Notice that there's one of these before each function declaration:

    with (_root) {
    }

I'm using the flare tool to decompile the swfs: http://www.nowrap.de/flare.html

It seems like the compiler is going overboard assuming every 'new foo()' means make a new Laszlo class called 'foo'. Let me know what you find!

-Max

Reply via email to