El tema es de espacio de nombres. Usualmente las clases dentro de un paquete son visibles dentro del mismo paquete, el warning que te da es lógico. Si lo haces público no hay restricciones y no hay warning. Algo usual es hacer tu propio espacio de nombres. Por ejemplo, he hecho unas clases e incorporo el espacio de nombres a mi objeto Application:
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
xmlns:form="com.flashdb.forms.*"
xmlns:msgs="com.flashdb.main.*" height="565">
Luego tengo una clase Messages que extiende VBox, la incorporo así:
<msgs:Messages x="84" y="10" width="300" height="260" id="main"></msgs:Messages>
Mi clase
Código :
package com.flashdb.main
{
import mx.containers.VBox
import com.flashdb.dto.Post
import mx.rpc.http.HTTPService;
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
import mx.controls.Label;
import flash.events.Event;
import mx.core.Application
import mx.controls.Label;
public class Messages extends VBox
{
private var myData:HTTPService
private var no_msg:Label
private var offset:Number = 0
public function Messages(){
super()
myData = new HTTPService()
myData.url = "http://localhost/Tutorials/flexloading/loadPosts.php"
myData.resultFormat = "flashvars"
myData.addEventListener(ResultEvent.RESULT, showEntries)
myData.addEventListener(FaultEvent.FAULT, onError)
init()
}
public function init():void{
myData.send()
}
public function showEntries(results:ResultEvent):void{
if(this.numChildren>1) for(var i:Number = this.numChildren-1; i>0; i--) removeChildAt(i)
for(i = 0; i<results.result.cant; i++){
var it:Post = new Post({alias:results.result["alias"+i],city:results.result["city"+i],country:results.result["country"+i],email:results.result["email"+i],msg:results.result["msg"+i]})
var t:displayRow = new displayRow()
t.setItem(it)
addChild(t)
offset +=(i<3)?t.height : 0
}
if(i<=0) {
var no_msg:Label = new Label()
no_msg.text = " No messages yet"
addChild(no_msg)
offset = 50
}
Application.application.moveForm(offset)
}
private function onError(evt:FaultEvent):void{
trace(evt.toString())
//no_msg.text = evt.toString()
}
}
}
Los trace los puedes ver en al panel de output de Flex si publicas como debugging
Jorge