Hi Matt,
 
I have no Loader in MXML. This is 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.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);    
   }
   
   private function handleComplete(event:Event) : void {
    
    var myimage:Image = new Image();
    var ldr2:flash.display.Loader = flash.display.Loader(event.target);
    myimage.load(ldr2.content);
    
    myvbox.addChild(myimage);
   ]]>
 </mx:Script>
 
 <mx:VBox id="myvbox">
  <mx:Button label="load" click="loadImage('http://192.168.1.3/private/rs/flex/images/large.jpg')"/>  
 </mx:VBox>
</mx:Application>
In function loadImage() i don't have to explictly use it with fully-qualified name, but i do have to use it in function handleComplete().
 
Also i still get the error message when i use import flash.display.Loader instead of import flash.display.* and removing flash.display. from the handleComplete() function.
 
Richard
 
 
 -----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED]On Behalf Of Matt Chotin
Sent: Tuesday, March 07, 2006 7:18 AM
To: [email protected]
Subject: RE: [flexcoders] Question about error 'Can not resolve a multiname reference...'

Yes there is a flash.display.Loader and an mx.controls.Loader.  Which one are you intending to use?  If you intended to use the flash.display.Loader but the mx.controls.Loader is present do you have a Loader in your MXML?  If vice versa that would be a bug I think because I’m not sure why the flash Loader would get imported.

 

Matt

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Abdul Qabiz
Sent: Monday, March 06, 2006 8:08 AM
To: [email protected]
Subject: Re: [flexcoders] Question about error 'Can not resolve a multiname reference...'

 

>thought that when using import mx.controls.Loader i could directly call
>Loader. Is that correct?
Right, but there is one Loader class in Flash Player API also, not sure if that is the reason you are getting that error...

If that is the case, you have to explictly use it with fully-qualified name

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


If that is the problem then compiler should be little more smart to understand things and make it easier for developers....


-abdul

On 3/6/06, Richard Schutten <[EMAIL PROTECTED]> wrote:

Hi there,

Why do i get the following error on building the project?

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

For example: I've used:

import mx.controls.Loader;

var myLoader:Loader = new Loader();

When i prepend mx.controls. for each Loader the problem is solved. But i
thought that when using import mx.controls.Loader i could directly call
Loader. Is that correct?


Richard



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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
     [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/






--
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




Reply via email to