Welcome, Guest. Please login or register.
Did you miss your activation email?
05/21/12, 04:38
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  General
| |-+  V2 Components (Flash MX 2004 - Flash 8) (Moderators: vesa kortelainen, Ronald Wernecke, Jorge Solis, ..:: Mazhar Hasan ::.., papachan)
| | |-+  Cant addItem to comboBox created on runtime
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: Cant addItem to comboBox created on runtime  (Read 3027 times)
Gabriela
Jr. Programmer
**
Posts: 63


View Profile Email
« on: 12/15/06, 08:02 »

What could be the problem?
Quote
import mx.controls.*;
var mcEscolheLivros:MovieClip;
var cbLivros:ComboBox;
mcEscolheLivros = this.createEmptyMovieClip("target", this.getNextHighestDepth());
cbLivros = mcEscolheLivros.createClassObject(ComboBox, "cb", mcEscolheLivros.getNextHighestDepth());
cbLivros.setSize(200);
cbLivros.addItem({data:1, label:"oi"});

REPORTED:
Quote
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 7: There is no method with the name 'addItem'.
     cbLivros.addItem({data:1, label:"oi"});
OBS> there's a comboBox in the lib
thanx
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #1 on: 12/15/06, 08:20 »

Use the instance name, createClassObject doesn't return a valid reference for method call

Jorge
Logged

Gabriela
Jr. Programmer
**
Posts: 63


View Profile Email
« Reply #2 on: 12/15/06, 09:58 »

ahnnnnnn
thanx a lot
 Cheesy
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!