Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
kako napraviti instancu od parametara u arrayu!?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Flash
View previous topic :: View next topic  
Author Message
fprebeg



Joined: 27 Aug 2008
Posts: 2
Location: zagerb

PostPosted: 24.02.2009 16:01    Post subject: kako napraviti instancu od parametara u arrayu!? Add user to your forum ignore list Reply with quote

ok imam AS3 problem.

imam array

var def=[];
def[0]="DropShadowFilter";
def[1]="1";
def[2]="45";
def[3]="0x000000"

od ovih podataka bi trebao napraviti filter instancu, znaci:


var moj_filter=new DropShadowFilter(1,45,0x000000);

ali sa podacima iz arraya...
Probao sam

var moj_filter=new def[0]() ;

ali ne radi

fakat nisam pametan kak to sloziti.
ima ko kakvu ideju?!
Question

_________________
Rule of Aquisition 285: No good deed ever goes unpunished
Back to top
View user's profile Send private message Visit poster's website
PaNtHeR



Joined: 17 Sep 2003
Posts: 161

PostPosted: 25.02.2009 11:34    Post subject: Add user to your forum ignore list Reply with quote

Code:
var def = [];
def[0] = "flash.filters.DropShadowFilter";
def[1] = "1";
def[2] = "45";
def[3] = "0x000000";

var moj_filter = new DropShadowFilter(1,45,0x000000);
var class_ref:Object = getDefinitionByName (def[0]) as Class;
var moj_filter2 = new class_ref(def[1],def[2],def[3]);

_________________
Back to top
View user's profile Send private message Send e-mail
fprebeg



Joined: 27 Aug 2008
Posts: 2
Location: zagerb

PostPosted: 25.02.2009 11:42    Post subject: Add user to your forum ignore list Reply with quote

super sve radi...
tnx a lot man! Smile

_________________
Rule of Aquisition 285: No good deed ever goes unpunished
Back to top
View user's profile Send private message Visit poster's website
gorrc



Joined: 12 Jul 2007
Posts: 87

PostPosted: 26.02.2009 12:50    Post subject: Add user to your forum ignore list Reply with quote

Treba napomenuti (ako se netko zaleti nešto slično radit)i da kreiranje instance preko getDefinitionByName neće uspjeti ako se prije toga ne kreira varijabla kojoj je dodjeljen tip klase koje će se kasnije probati kreirati.

Znači gornji primjer bez:var moj_filter = new DropShadowFilter(1,45,0x000000); nebi trebao raditi (nemam vremena da isprobam ali je tako).
Ukoliko vam netreba novi filter može se samo napraviti varijabla s tipom od te klase
var moj_filter:DropShadowFilter;
Ali u svakom slučaju ako se nigdje u vašoj aplikaciji ne instancira, u ovom primjeru DropShadowFilter , ali vrijedi za bilo koju drugu klasu Flash Player če "odbiti" kreirati klasu preko getDefinitionByName.

_________________
www.topnogomet.com -- http://www.gorrc.blogspot.com/ - http://code.google.com/p/bet-script/
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Flash All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group