[Flashcoders] How to Create a FLASH CS3 Component?

2007-09-10 Thread Enrique Chávez

Hi there,

i made a lot of as2 based components in the past. Now i need to create a 
new one in AS3, I cant find anything in the flash's docs i only find a 
few sites talking about AS3 componentes.


I understand, are 2 components type, a FLA based and the old SWC.

i try to create a new SWC component. something easy to start.

MovieClip Symbol in the Library call it window
Linkage Class window
Base Class : flash.display.MovieClip

Component Definition: window

I only have a asset in the stage for this component a MovieClip Instance 
name mc_test then in my class window.as just a few lines


package {

   import flash.display.MovieClip
   public class window extends MovieClip   
   {

   public function window()
  {
   createChildren();
   }
   private function createChildren():void
  {
   trace(mc_test)
   }
   }
}

Ctrl+Enter and everything work,  i get [object MovieClip],  BUT when i 
export this using Convert to Compiled Clip or Export SWC File and 
then i try to use this component in a new Flash File y get :


ReferenceError: Error #1056: Cannot create property mc_test on window.
   at flash.display::Sprite/flash.display:Sprite::constructChildren()
   at flash.display::Sprite$iinit()
   at flash.display::MovieClip$iinit()
   at window$iinit()
   at flash.display::Sprite/flash.display:Sprite::constructChildren()
   at flash.display::Sprite$iinit()
   at flash.display::MovieClip$iinit()

I really don't understand why, and i can't find information about it

Thanks in advance


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Loading xml in AS 2

2007-08-03 Thread Enrique Chávez

You have to wait for the onLoad Event

class LoadXML {

   function LoadXML() {
   var xmlData:XML = new XML();

   xmlData.ignoreWhite= true;
   xmlData.onLoad = function (success) {
   if(success) {
   trace(loaded);
		trace(xmlData);
	 }

   }
   xmlData.load(data.xml);
   
   }

}



Omar Fouad escribió:

class LoadXML {

function LoadXML() {
var xmlData:XML = new XML();

xmlData.ignoreWhite= true;
xmlData.onLoad = function (success) {
if(success) {
trace(loaded);
}
}
xmlData.load(data.xml);
trace(xmlData);
}
}
this is not working

  



--
Enrique Chavez aka Tmeister
http://www.klr20mg.com
http://www.tmeister.net
http://desktoptwo.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] MouseEvent.DOUBLE_CLICK Bug?

2007-07-12 Thread Enrique Chávez

Hi.

I am trying to use the doubleClick event, but it never trigger the handler

My function is something like that

private function loadIconComplete(event:Event):void
{
   var rIcon:LoaderInfo = event.target as LoaderInfo
   var fIcon = rIcon.loader
   var iStage =  lIcon.content as MovieClip
   iStage.label.autoSize = TextFieldAutoSize.CENTER
   iStage.label.text = xmlInfo.appProperties.label
   iStage.hit.x = iStage.label.x
   iStage.hit.width = iStage.label.width
   iStage.hit.addEventListener(MouseEvent.DOUBLE_CLICK, dobleClick);
   iStage.hit.addEventListener(MouseEvent.CLICK, onClick);
   iStage.hit.addEventListener(MouseEvent.MOUSE_DOWN, onDown);
   iStage.hit.addEventListener(MouseEvent.MOUSE_UP, onUp);
   iStage.icon.addChild(fIcon)
}

All the events trigger the handlers except the doubleClick

i also try with a simple sample.

in a normal FLA 1 frame

import flash.display.Sprite;
import flash.events.*;
var size:uint= 100;
var bgColor:uint = 0xFFCC00;
function SpriteExample() {
   var child : Sprite = new Sprite();
   child.addEventListener(MouseEvent.DOUBLE_CLICK, dobleClick);
   child.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
   draw(child);
   addChild(child);
}
function dobleClick(event:MouseEvent):void {
   trace(dobleClick);
}
function mouseUpHandler(event:MouseEvent):void {
   trace(mouseUpHandler);
}
function draw(sprite : Sprite):void {
   sprite.graphics.beginFill(bgColor);
   sprite.graphics.drawRect(0, 0, size, size);
   sprite.graphics.endFill();
}
SpriteExample();

And dont work .

Anyone know something about it..??

Cheers

--
Enrique Chavez aka Tmeister
http://www.klr20mg.com
http://www.tmeister.net
http://desktoptwo.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] MouseEvent.DOUBLE_CLICK Bug?

2007-07-12 Thread Enrique Chávez

Damn,

I have to read the Docs first...
I have to read the Docs first...
I have to read the Docs first...
I have to read the Docs first...

jeje.

Thanks a Sorry.


Rákos Attila escribió:

You have to enable this event by setting the object's
doubleClickEnabled property to true.

  Attila

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
From:Enrique Chávez [EMAIL PROTECTED]
To:  Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Date:Thursday, July 12, 2007, 9:02:06 PM
Subject: [Flashcoders] MouseEvent.DOUBLE_CLICK Bug?
--===--
Hi.

I am trying to use the doubleClick event, but it never trigger the handler

My function is something like that

private function loadIconComplete(event:Event):void
{
var rIcon:LoaderInfo = event.target as LoaderInfo
var fIcon = rIcon.loader
var iStage =  lIcon.content as MovieClip
iStage.label.autoSize = TextFieldAutoSize.CENTER
iStage.label.text = xmlInfo.appProperties.label
iStage.hit.x = iStage.label.x
iStage.hit.width = iStage.label.width
iStage.hit.addEventListener(MouseEvent.DOUBLE_CLICK, dobleClick);
iStage.hit.addEventListener(MouseEvent.CLICK, onClick);
iStage.hit.addEventListener(MouseEvent.MOUSE_DOWN, onDown);
iStage.hit.addEventListener(MouseEvent.MOUSE_UP, onUp);
iStage.icon.addChild(fIcon)
}

All the events trigger the handlers except the doubleClick

i also try with a simple sample.

in a normal FLA 1 frame

import flash.display.Sprite;
import flash.events.*;
var size:uint= 100;
var bgColor:uint = 0xFFCC00;
function SpriteExample() {
var child : Sprite = new Sprite();
child.addEventListener(MouseEvent.DOUBLE_CLICK, dobleClick);
child.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
draw(child);
addChild(child);
}
function dobleClick(event:MouseEvent):void {
trace(dobleClick);
}
function mouseUpHandler(event:MouseEvent):void {
trace(mouseUpHandler);
}
function draw(sprite : Sprite):void {
sprite.graphics.beginFill(bgColor);
sprite.graphics.drawRect(0, 0, size, size);
sprite.graphics.endFill();
}
SpriteExample();

And dont work .

Anyone know something about it..??

Cheers

  



--
Enrique Chavez aka Tmeister
http://www.klr20mg.com
http://www.tmeister.net
http://desktoptwo.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] WebServices support in AS3/FLCS3

2007-07-09 Thread Enrique Chávez

Hi John.

Well, great news, you know, we are working to offer a API for people who 
want to develop applications in the http://desktoptwo.com base, 
desktoptwo is full flash and we really need the Webservice Support.


And i dont want use flex. =)

Thanks.


John Dowdell escribió:

Enrique Chávez wrote:
What happened with the webservices classes in AS3/Flash CS3?  i can't 
believe they are gone.


I asked Product Manager Richard Galvan about this earlier this week, 
and I'll ping him today face-to-face to confirm. Here's where I'd 
expect info to appear first, if it isn't already among the technotes 
somewhere:

http://blogs.adobe.com/rgalvan/

I suspect that it's something like not all AS2 routines yet adapted 
for the tighter ECMAScript in AS3, but even if so this info should 
still already be available in a FAQ or other searchable resource.


I'm sorry for the hassle in the meantime, but I've got an action item 
to pursue this and get it publicly resolved. (I'll be on vacation next 
week; if it's not addressed by then please feel free to title a thread 
JD Flakes Out! on Flashcoders the week of the 16th to nudge my 
memory, thanks ;-)


jd











--
Enrique Chavez aka Tmeister
http://www.klr20mg.com
http://www.tmeister.net
http://desktoptwo.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] WebServices support in AS3/FLCS3

2007-07-04 Thread Enrique Chávez

Really

What happened with the webservices classes in AS3/Flash CS3?  i can't 
believe they are gone.


Anyone know something about it?

--
Enrique Chavez aka Tmeister
http://www.klr20mg.com
http://www.tmeister.net
http://desktoptwo.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com