Hi there,
Anybody knows a way of setting the linkage identifier of the movie clip symbol in the Object.registerClass dynamically?
If I write “LinkageId” between " " it works fine…
[COLOR=blue]Object.registerClass(“LinkageId” ,MyClass);[/COLOR]
BUT if I don’t use " " and try to set the contents of a variable, it doesn’t work
[COLOR=red]
myLinkId = “XXX”;
Object.registerClass(myLinkId ,MyClass);[/COLOR]
I’ve already tried to concatenate " " to myLinkId and it still doesn’t work…
I need to dynamically register lots of MCs to myClass
Anybody has a tip on how to do it ?
Thanks in advance,
Spongebob.
system
August 14, 2002, 4:35pm
2
Anybody … ? Please help me on this subject…
Any tip I can try will be helpful…
Thanks,
Spongebob
system
August 14, 2002, 5:09pm
3
Why do you always come up with tough questions like that?
I’ve never actually programmed components, so I don’t have your answer, but I’ll try and ask my Chinese master, he may know.
pom :asian:
system
August 14, 2002, 5:27pm
4
Sorry :-\
I’ve lately came up with these strange things …, haven’t I ?
I hope this is the last thing I cannot solve by myself
Thanks for your and your master’s help =)
Spongebob.
system
August 15, 2002, 12:37am
5
i was unable to get this method to work with anything aside from exported library assets. i’m not sure it that’s the intention or i was just doing it wrong.
are you able to set a particular movie clip’s class with this method?
with library assets though, it worked happily with or without variables. i exported an asset under the name “sqr” from the library and this code worked fine:
function Classy(){
this.class = "Classy";
this.onMouseUp = function(){ trace("i'm classy!"); };
};
item = "sqr";
Object.registerClass(item,Classy);
_root.attachMovie("sqr","square",0);
i’m thinking that you’re trying to do something a little different but i’m not sure what.
for a heavy read, you could browse dave yang’s site on oop in flash.
http://www.quantumwave.com/flash/
system
August 15, 2002, 1:40pm
6
Great sbeener ! =)
This is exactly what I’m trying to do!, worked marvellous!
I now know what I was doing wrong :*(
I was trying to register the item with the class right after the attachMovie sentence !! I’m such a #?$#"&% !!
Thank you very much for your help!
Regards,
Spongebob.