Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by riceje7

So i am trying to call ClassB from ClassA in a plugin I'm writing, here's the structure:

ig.module('plugin.plugin').requires('impact.impact').defines(function(){
    ClassA = ig.Class.extend({
        obj: null,
        ...
        randomFunc: function(){
            this.obj = new ClassB();
        }
    });
    ClassB = ig.Class.extend({
        init: function(){
            ...
        }
    });
});

i've generalized the names and such but the structure is identical
I am getting an uncaught reference error saying ClassB is not defined.
I know you can do this with `ig.Entity` by spawning the new entity and i thought that I had done it with `ig.Class` but i can't figure out what im doing wrong. can anyone help me out? if you need anymore info just ask. thanks

1 decade ago by riceje7

disregard i found the mistake.

1 decade ago by Graphikos

What was the problem? Order of execution?

1 decade ago by riceje7

nope ClassB was defined as:
ClassB: ... 

instead of:

ClassB = ...

simple mistake, had a colon instead of an equals sign that i didn't see.
Page 1 of 1
« first « previous next › last »