[flexcoders] Error can not resolve a multiname reference unambiguously...

2006-03-08 Thread Richard Schutten





Hi there,I still get the following error:
Can not resolve a multiname reference 
unambiguously. flash.display:Loader(fromframework.swc(mx/controls/loader)) 
are available.
Please take a look at my code:?xml 
version="1.0" encoding="utf-8"?mx:Application 
xmlns:mx="http://www.macromedia.com/2005/mxml" 
xmlns="*" layout="absolute" 
mx:Script 
 
![CDATA[ 
 
 import 
mx.controls.ProgressBar; 
 
 import 
mx.controls.Alert; 
 
 import 
mx.controls.Image; 
 
 
 
 import 
flash.events.*; 
 
 import 
flash.display.*; 
 
 
 
 private function 
loadImage(url:String) : void {  
 
 
 
 
 
 
 
 var myloader:Loader = new 
Loader(); 
 
 
 
addEventListeners(myloader); 
 
 
 
 
 
 var myprogress:ProgressBar = new 
ProgressBar(); 
 
 
 myprogress.name = 
'myprogress'; 
 
 
 myprogress.source = 
myloader; 
 
 
 
myvbox.addChild(myprogress); 
 
 
 
 
 
 var myurlrequest:URLRequest = new 
URLRequest(url); 
 
 
 
myloader.load(myurlrequest); 
 
 
} 
 
 
 
 private function 
addEventListeners(ldr:Loader) : void 
{ 
 
 
 ldr.addEventListener(Event.COMPLETE, 
handleComplete);  
 
 
 
 
 
ldr.addEventListener(IOErrorEvent.IO_ERROR, 
handleIOError); 
 
 
 
ldr.addEventListener(HTTPStatusEvent.HTTP_STATUS, 
handleHTTPStatus); 
 
 
} 
 
 
 
 private function 
handleComplete(event:Event) : void 
{ 
 
 
 
 
 
 var myimage:Image = new 
Image(); 
 
 
 myimage.width = 
640; 
 
 
 myimage.height = 
480; 
 
 
 var ldr2:flash.display.Loader = 
flash.display.Loader(event.target); 
 
 
 
myimage.load(ldr2.content); 
 
 
 
 
 
 
myvbox.addChild(myimage); 
 
 
 
 
 
 //hide progressbar when image is 
loaded 
 
 
 
myvbox.getChildByName('myprogress').visible = 
false; 
 
 
} 
 
 
 
 private function 
handleIOError(event:IOErrorEvent) : void 
{ 
 
 
 Alert.show('file not found', 'IO 
error'); 
 
 } 
 
 
 
 
 
 
 
 
 private function 
handleHTTPStatus(event:HTTPStatusEvent) : void 
{ 
 
 
 if (event.status != 200)//200 = HTTP 
STATUS OK  
 
 
 
 
 
 Alert.show('HTTP error: ' + 
event.status, 'HTTP error'); 
 
 } 
 
 
 
 
 
]] 
/mx:Script 
mx:Model id="persons" 
 
result 
 
 
item 
 
 
 
id10/id 
 
 
 
nameRichard/name 
 
 
 
 
 
/item 
 
 
item 
 
 
 
id20/id 
 
 
 
nameBas/name 
 
 
 
 
 
/item 
 
 
item 
 
 
 
id30/id 
 
 
 
nameDimitry/name 
 
 
 
 
 /item 
 
 
 
 
 
 
/result 
/mx:Model 
mx:VBox id="myvbox" 
 mx:Button label="load" 
click="loadImage('http://...')"/ 
 mx:ComboBox id="combo" 
labelField="name" dataProvider="{persons.result.item}"/ 
/mx:VBox/mx:Application 
This results in an error:
mx:ComboBox id="combo" labelField="name" 
dataProvider="{persons.result.item}"/
This too:
mx:ComboBox id="combo" 
labelField="name" dataProvider="{}"/
And this is no problem:
mx:ComboBox id="combo" 
labelField="name" dataProvider=""/
Why? It doesn't make sense to me!
Richard






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  









RE: [flexcoders] Error can not resolve a multiname reference unambiguously...

2006-03-08 Thread Roger Gonzalez





Change the line in loadImage to:

var myloader:mx.controls.Loader = new 
mx.controls.Loader();

or

var myloader:flash.display.Loader = new 
flash.display.Loader();

depending on which you want.

If you were to have used mx:Loader as a MXML tag, 
we spell out the entire mx.controls.Loader version. Because you're 
importing flash.display.* in a MXML document (which is using the MXML namespace, 
which makes everything in mx.* available), and there's a flash.display.Loader, 
it doesn't know which one you want.

-rg




From: 
flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
Richard SchuttenSent: Wednesday, March 08, 2006 1:36 
AMTo: [EMAIL PROTECTED] ComSubject: [flexcoders] 
Error can not resolve a multiname reference 
unambiguously...

  
  Hi there,I still get the following error:
  Can not resolve a multiname reference 
  unambiguously. flash.display:Loader(fromframework.swc(mx/controls/loader)) 
  are available.
  Please take a look at my code:?xml version="1.0" 
  encoding="utf-8"?mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml" xmlns="*" 
  layout="absolute" 
  mx:Script 
   
  ![CDATA[ 
   
   import 
  mx.controls.ProgressBar; 
   
   import 
  mx.controls.Alert; 
   
   import 
  mx.controls.Image; 
   
   
   
   import 
  flash.events.*; 
   
   import 
  flash.display.*; 
   
   
   
   private function 
  loadImage(url:String) : void {  
   
   
   
   
   
   
   
   var myloader:Loader = new 
  Loader(); 
   
   
   
  addEventListeners(myloader); 
   
   
   
   
   
   var myprogress:ProgressBar = new 
  ProgressBar(); 
   
   
   myprogress.name = 
  'myprogress'; 
   
   
   myprogress.source = 
  myloader; 
   
   
   
  myvbox.addChild(myprogress); 
   
   
   
   
   
   var myurlrequest:URLRequest = new 
  URLRequest(url); 
   
   
   
  myloader.load(myurlrequest); 
   
   
  } 
   
   
   
   private function 
  addEventListeners(ldr:Loader) : void 
  { 
   
   
   
  ldr.addEventListener(Event.COMPLETE, handleComplete); 
   
   
   
   
   
   
  ldr.addEventListener(IOErrorEvent.IO_ERROR, 
  handleIOError); 
   
   
   
  ldr.addEventListener(HTTPStatusEvent.HTTP_STATUS, 
  handleHTTPStatus); 
   
   
  } 
   
   
   
   private function 
  handleComplete(event:Event) : void 
  { 
   
   
   
   
   
   var myimage:Image = new 
  Image(); 
   
   
   myimage.width = 
  640; 
   
   
   myimage.height = 
  480; 
   
   
   var ldr2:flash.display.Loader = 
  flash.display.Loader(event.target); 
   
   
   
  myimage.load(ldr2.content); 
   
   
   
   
   
   
  myvbox.addChild(myimage); 
   
   
   
   
   
   //hide progressbar when image is 
  loaded 
   
   
   
  myvbox.getChildByName('myprogress').visible = 
  false; 
   
   
  } 
   
   
   
   private function 
  handleIOError(event:IOErrorEvent) : void 
  { 
   
   
   Alert.show('file not found', 'IO 
  error'); 
   
   
  } 
   
   
   
   
   
   
   
   
   private function 
  handleHTTPStatus(event:HTTPStatusEvent) : void 
  { 
   
   
   if (event.status != 200)//200 = 
  HTTP STATUS OK  
   
   
   
   
   
   Alert.show('HTTP error: ' + 
  event.status, 'HTTP error'); 
   
   
  } 
   
   
   
   
   
  ]] 
  /mx:Script 
  mx:Model id="persons" 
   
  result 
   
   
  item 
   
   
   
  id10/id 
   
   
   
  nameRichard/name 
   
   
   
   
   
  /item 
   
   
  item 
   
   
   
  id20/id 
   
   
   
  nameBas/name 
   
   
   
   
   
  /item 
   
   
  item 
   
   
   
  id30/id 
   
   
   
  nameDimitry/name 
   
   
   
   
   /item 
   
   
   
   
   
   
  /result 
  /mx:Model 
  mx:VBox id="myvbox" 
   mx:Button label="load" 
  click="loadImage('http://...')"/ 
   mx:ComboBox id="combo" 
  labelField="name" dataProvider="{persons.result.item}"/ 
  /mx:VBox/mx:Application 
  This results in an error:
  mx:ComboBox id="combo" labelField="name" 
  dataProvider="{persons.result.item}"/
  This too:
  mx:ComboBox id="combo" 
  labelField="name" dataProvider="{}"/
  And this is no problem:
  mx:ComboBox id="combo" 
  labelField="name" dataProvider=""/
  Why? It doesn't make sense to me!
  Richard
  





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  









RE: [flexcoders] Error can not resolve a multiname reference unambiguously...

2006-03-08 Thread Gordon Smith










In



 var myloader:Loader = new Loader();



you probably need to change both Loaders to be
either flash.display.Loader or mx.controls.Loader, to dismbiguate these two
classes which unfortunately have the same short name, like you did farther down
with



 ldr2:flash.display.Loader =
flash.display.Loader(event.target);



- Gordon











From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Richard Schutten
Sent: Wednesday, March 08, 2006
1:36 AM
To: [EMAIL PROTECTED] Com
Subject: [flexcoders] Error can
not resolve a multiname reference unambiguously...





Hi there,

I still get the following error:

Can not resolve a multiname reference unambiguously.
flash.display:Loader(fromframework.swc(mx/controls/loader)) are available.


Please take a look at my code:

?xml version=1.0
encoding=utf-8?
mx:Application xmlns:mx=http://www.macromedia.com/2005/mxml
xmlns=* layout=absolute
 mx:Script

 ![CDATA[


 import mx.controls.ProgressBar;


 import mx.controls.Alert;


 import mx.controls.Image;




 import flash.events.*;


 import flash.display.*;





 private function
loadImage(url:String) : void { 









 var myloader:Loader = new Loader();



 addEventListeners(myloader);







 var myprogress:ProgressBar = new
ProgressBar();



 myprogress.name = 'myprogress';



 myprogress.source = myloader;



 myvbox.addChild(myprogress);







 var myurlrequest:URLRequest = new
URLRequest(url);



 myloader.load(myurlrequest);


 }





 private function
addEventListeners(ldr:Loader) : void {

 
 ldr.addEventListener(Event.COMPLETE,
handleComplete); 
 




ldr.addEventListener(IOErrorEvent.IO_ERROR, handleIOError);




ldr.addEventListener(HTTPStatusEvent.HTTP_STATUS, handleHTTPStatus);


 }





 private function
handleComplete(event:Event) : void {







 var myimage:Image = new Image();



 myimage.width = 640;



 myimage.height = 480;



 var ldr2:flash.display.Loader =
flash.display.Loader(event.target);



 myimage.load(ldr2.content);







 myvbox.addChild(myimage);







 //hide progressbar when image is
loaded



 myvbox.getChildByName('myprogress').visible
= false;


 }





 private function
handleIOError(event:IOErrorEvent) : void {



 Alert.show('file not found', 'IO
error');
 

}


 






 private function
handleHTTPStatus(event:HTTPStatusEvent) : void {



 if (event.status != 200)//200 = HTTP
STATUS OK 






 Alert.show('HTTP error: ' +
event.status, 'HTTP error');



}

 


 ]]
 /mx:Script

 mx:Model id=persons

 result


 item



 id10/id




nameRichard/name





 /item


 item



 id20/id




nameBas/name 




 /item


 item



 id30/id




nameDimitry/name





 /item

 



 /result

/mx:Model

 mx:VBox
id=myvbox

 mx:Button label=load
click=loadImage('http://...')/

 mx:ComboBox id=combo
labelField=name dataProvider={persons.result.item}/
 /mx:VBox
/mx:Application 

This
results in an error:

mx:ComboBox
id=combo labelField=name dataProvider={persons.result.item}/

This
too:

mx:ComboBox
id=combo labelField=name dataProvider={}/

And
this is no problem:

mx:ComboBox
id=combo labelField=name dataProvider=/

Why?
It doesn't make sense to me!

Richard











--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.