Re: [Flashcoders] Help Registration point and origion point

2011-08-03 Thread nasim hhhhh

Hi
I'm Really appreciate u 
I want to simulate Osiloscope . Part of My program give me x,y and I shoudl 
draw wave base on that point in osiloscope  ,my osiloscope should have scalex 
and y i should can move to right and left up and down 
I cant make it dynamically so i make 2 empty MovieClip nested in firt mc I draw 
my wave and move it left and Right and in parent I use scale but it has a bit 
bug  and my wave will be thiker after  scale
what do u do it and how to program it 

this is my  problem can u help me 
omethin like this not actually 
http://d.violet.vn/uploads/resources/171/scope.swf
--- On Tue, 8/2/11, Ktu ktu_fl...@cataclysmicrewind.com wrote:

From: Ktu ktu_fl...@cataclysmicrewind.com
Subject: Re: [Flashcoders] Help Registration point and origion point
To: Flash Coders List flashcoders@chattyfig.figleaf.com
Date: Tuesday, August 2, 2011, 10:33 AM

Hopefully below will help you:

I'm going to just explain how the origin stuff works, and how you can learn
to compensate for it, and maybe you can apply this to your work. Starting
off with an example where the visual elements of a sprite are not originated
at 0,0

var mySprite:Sprite = new Sprite ();
mySprite.graphics.beginFill();
mySprite.graphics.drawRect (10, 10, 50, 50);
mySprite.graphics.endFill();
mySprite.x = 10;
mySprite.y = 10;
stage.addChild(mySprite);

*the stage thinks this:*
mySprite.x = 10;
mySprite.y = 10;
mySprite.width = 50;
mySprite.height = 50;

*mySprite thinks this:*
this.x = 10;
this.y = 10;
this.width = 50;
this.height = 50;

But what happened to the fact that the rectangle I drew lives at x:10, y:10
!!!


*So how do you find out where the origin is from inside mySprite?*
 - mySprite.getBounds(mySprite);

this will return the boundaries of mySprite, in relation to mySprite. The
visual reality of mySprite is that its boundaries are this:

x: 10
y: 10
width:50
height:50


your origin offset is x:10, y:10. This still doesn't account for the x and y
placement of mySprite on the stage, but that is simple to calculate.


*The next part, is compensating for the scale:
**
*If you take our mySprite from above, and scale it to 2, there are some
notable changes:
 - mySprite.scaleX = mySprite.scaleY = 2;

mySprite thinks:
x:10
y:10
width:100
height:100

mySprite.getBounds(mySprite) returns this:
x:10
y:10
width:50
height:50

The visual elements inside of mySprite did not grow, but mySprite is telling
it to grow (because of the scaleX | scaleY changes)

But what is probably messing you up is that when you scale an object that
has an origin offset, the distance between the origin offset is multiplied
by the same scale.

*Here's the example:* (same mySprite as above, and already scaleX and scaleY
= 2)

mySprite is located at x:10, y:10
mySprite is scaled to 2, with an origin offset of x:10,. y:10.
multiply the origin offsets by the scale of the object and you get x:20,
y:20

the visual position of mySprite is at x:30, y:30

We can verify this by using getBounds again, but in relation to the stage.
mySprite.getBounds(stage);

returns:
x:30
y:30
width:100
height:100



So, an example to compensate for the offset and scale would go like this:
(if you want mySprite to *look* like its at 0,0 on the stage)

var myBounds:Rectangle = mySprite.getBounds(mySprite);
var originOffset:Point = new Point()
originOffset.x = -myBounds.x * mySprite.scaleX
originOffset.y = -myBounds.y * mySprite.scaleY;
mySprite.x = originOffset.x;
mySprite.y = originOffset.y;


Now, mySprite will appear to be at 0,0 on the stage, even though the origin
is offset and the scale has been changed.


*Solutions*

You can try compensation for both the origin and scale, or you can change
the way you scale, say by scaling the actual sin wave and not the containing
parent. You could also just redraw the wave instead of changing the scale.


Hope that helps.


the end code I used:

var mySprite:Sprite = new Sprite ();
mySprite.graphics.beginFill(0);
mySprite.graphics.drawRect (10, 10, 50, 50);
mySprite.graphics.endFill();
mySprite.x = 10;
mySprite.y = 10;
stage.addChild(mySprite);
mySprite.scaleX = mySprite.scaleY = 2;

var props:Rectangle = new Rectangle(mySprite.x, mySprite.y, mySprite.width,
mySprite.height);
trace(mySprite x,y,width,height:  + props);
trace(mySprite.getBounds(mySprite) =  + mySprite.getBounds(mySprite));
trace(mySprite.getBounds(stage) =  + mySprite.getBounds(stage));

var myBounds:Rectangle = mySprite.getBounds(mySprite);
var originOffset:Point = new Point()
originOffset.x = -myBounds.x * mySprite.scaleX
originOffset.y = -myBounds.y * mySprite.scaleY;
mySprite.x = originOffset.x;
mySprite.y = originOffset.y;



On Tue, Aug 2, 2011 at 1:03 AM, nasim h iranebah...@yahoo.com wrote:

 Hi

 Could u help me .  i draw wave( by code) inside empy movieClip that se
 regpoint (manualy)  at middle of that when i scale it t it’s good but
 when i move align x or y It scaled by pevios position  . I want to change
 reg point and refrence point
 too , like when i do

Re: [Flashcoders] Help Registration point and origion point

2011-08-03 Thread Glen Pike

Hello,

I did some stuff a long time ago with moving particles along a sine 
wave type path where you can control the frequency and amplitude.


Not sure if it will help much - the code is in (probably old bad) 
AS2, but you are welcome to look at it and borrow if it's any help.  You 
would need to update the position of a single particle as it moves 
along the waveform and draw a line from this to your previous point.


If you click and drag on the SWF vertical changes amplitude, 
horizontal changes frequency.  It's a good visual example of aliasing in 
action too - if you increase the frequency, the shape appears to cycle.


By the way, your frequency control on your scope appears to be 
backwards - turning anti-clockwise increases the frequency.


Hope this helps.

http://glenpike.co.uk/play/sinewave.html

Source: http://glenpike.co.uk/play/flash/sinewave.fla

Glen

On 03/08/2011 09:40, nasim h wrote:

Hi
I'm Really appreciate u
I want to simulate Osiloscope . Part of My program give me x,y and I shoudl 
draw wave base on that point in osiloscope  ,my osiloscope should have scalex 
and y i should can move to right and left up and down
I cant make it dynamically so i make 2 empty MovieClip nested in firt mc I draw 
my wave and move it left and Right and in parent I use scale but it has a bit 
bug  and my wave will be thiker after  scale
what do u do it and how to program it

this is my  problem can u help me
omethin like this not actually
http://d.violet.vn/uploads/resources/171/scope.swf
--- On Tue, 8/2/11, Ktuktu_fl...@cataclysmicrewind.com  wrote:

From: Ktuktu_fl...@cataclysmicrewind.com
Subject: Re: [Flashcoders] Help Registration point and origion point
To: Flash Coders Listflashcoders@chattyfig.figleaf.com
Date: Tuesday, August 2, 2011, 10:33 AM

Hopefully below will help you:

I'm going to just explain how the origin stuff works, and how you can learn
to compensate for it, and maybe you can apply this to your work. Starting
off with an example where the visual elements of a sprite are not originated
at 0,0

var mySprite:Sprite = new Sprite ();
mySprite.graphics.beginFill();
mySprite.graphics.drawRect (10, 10, 50, 50);
mySprite.graphics.endFill();
mySprite.x = 10;
mySprite.y = 10;
stage.addChild(mySprite);

*the stage thinks this:*
mySprite.x = 10;
mySprite.y = 10;
mySprite.width = 50;
mySprite.height = 50;

*mySprite thinks this:*
this.x = 10;
this.y = 10;
this.width = 50;
this.height = 50;

But what happened to the fact that the rectangle I drew lives at x:10, y:10
!!!


*So how do you find out where the origin is from inside mySprite?*
  - mySprite.getBounds(mySprite);

this will return the boundaries of mySprite, in relation to mySprite. The
visual reality of mySprite is that its boundaries are this:

x: 10
y: 10
width:50
height:50


your origin offset is x:10, y:10. This still doesn't account for the x and y
placement of mySprite on the stage, but that is simple to calculate.


*The next part, is compensating for the scale:
**
*If you take our mySprite from above, and scale it to 2, there are some
notable changes:
  - mySprite.scaleX = mySprite.scaleY = 2;

mySprite thinks:
x:10
y:10
width:100
height:100

mySprite.getBounds(mySprite) returns this:
x:10
y:10
width:50
height:50

The visual elements inside of mySprite did not grow, but mySprite is telling
it to grow (because of the scaleX| scaleY changes)

But what is probably messing you up is that when you scale an object that
has an origin offset, the distance between the origin offset is multiplied
by the same scale.

*Here's the example:* (same mySprite as above, and already scaleX and scaleY
= 2)

mySprite is located at x:10, y:10
mySprite is scaled to 2, with an origin offset of x:10,. y:10.
multiply the origin offsets by the scale of the object and you get x:20,
y:20

the visual position of mySprite is at x:30, y:30

We can verify this by using getBounds again, but in relation to the stage.
mySprite.getBounds(stage);

returns:
x:30
y:30
width:100
height:100



So, an example to compensate for the offset and scale would go like this:
(if you want mySprite to *look* like its at 0,0 on the stage)

var myBounds:Rectangle = mySprite.getBounds(mySprite);
var originOffset:Point = new Point()
originOffset.x = -myBounds.x * mySprite.scaleX
originOffset.y = -myBounds.y * mySprite.scaleY;
mySprite.x = originOffset.x;
mySprite.y = originOffset.y;


Now, mySprite will appear to be at 0,0 on the stage, even though the origin
is offset and the scale has been changed.


*Solutions*

You can try compensation for both the origin and scale, or you can change
the way you scale, say by scaling the actual sin wave and not the containing
parent. You could also just redraw the wave instead of changing the scale.


Hope that helps.


the end code I used:

var mySprite:Sprite = new Sprite ();
mySprite.graphics.beginFill(0);
mySprite.graphics.drawRect (10, 10, 50, 50);
mySprite.graphics.endFill();
mySprite.x = 10;
mySprite.y

Re: [Flashcoders] Help Registration point and origion point

2011-08-02 Thread Ktu
Hopefully below will help you:

I'm going to just explain how the origin stuff works, and how you can learn
to compensate for it, and maybe you can apply this to your work. Starting
off with an example where the visual elements of a sprite are not originated
at 0,0

var mySprite:Sprite = new Sprite ();
mySprite.graphics.beginFill();
mySprite.graphics.drawRect (10, 10, 50, 50);
mySprite.graphics.endFill();
mySprite.x = 10;
mySprite.y = 10;
stage.addChild(mySprite);

*the stage thinks this:*
mySprite.x = 10;
mySprite.y = 10;
mySprite.width = 50;
mySprite.height = 50;

*mySprite thinks this:*
this.x = 10;
this.y = 10;
this.width = 50;
this.height = 50;

But what happened to the fact that the rectangle I drew lives at x:10, y:10
!!!


*So how do you find out where the origin is from inside mySprite?*
 - mySprite.getBounds(mySprite);

this will return the boundaries of mySprite, in relation to mySprite. The
visual reality of mySprite is that its boundaries are this:

x: 10
y: 10
width:50
height:50


your origin offset is x:10, y:10. This still doesn't account for the x and y
placement of mySprite on the stage, but that is simple to calculate.


*The next part, is compensating for the scale:
**
*If you take our mySprite from above, and scale it to 2, there are some
notable changes:
 - mySprite.scaleX = mySprite.scaleY = 2;

mySprite thinks:
x:10
y:10
width:100
height:100

mySprite.getBounds(mySprite) returns this:
x:10
y:10
width:50
height:50

The visual elements inside of mySprite did not grow, but mySprite is telling
it to grow (because of the scaleX | scaleY changes)

But what is probably messing you up is that when you scale an object that
has an origin offset, the distance between the origin offset is multiplied
by the same scale.

*Here's the example:* (same mySprite as above, and already scaleX and scaleY
= 2)

mySprite is located at x:10, y:10
mySprite is scaled to 2, with an origin offset of x:10,. y:10.
multiply the origin offsets by the scale of the object and you get x:20,
y:20

the visual position of mySprite is at x:30, y:30

We can verify this by using getBounds again, but in relation to the stage.
mySprite.getBounds(stage);

returns:
x:30
y:30
width:100
height:100



So, an example to compensate for the offset and scale would go like this:
(if you want mySprite to *look* like its at 0,0 on the stage)

var myBounds:Rectangle = mySprite.getBounds(mySprite);
var originOffset:Point = new Point()
originOffset.x = -myBounds.x * mySprite.scaleX
originOffset.y = -myBounds.y * mySprite.scaleY;
mySprite.x = originOffset.x;
mySprite.y = originOffset.y;


Now, mySprite will appear to be at 0,0 on the stage, even though the origin
is offset and the scale has been changed.


*Solutions*

You can try compensation for both the origin and scale, or you can change
the way you scale, say by scaling the actual sin wave and not the containing
parent. You could also just redraw the wave instead of changing the scale.


Hope that helps.


the end code I used:

var mySprite:Sprite = new Sprite ();
mySprite.graphics.beginFill(0);
mySprite.graphics.drawRect (10, 10, 50, 50);
mySprite.graphics.endFill();
mySprite.x = 10;
mySprite.y = 10;
stage.addChild(mySprite);
mySprite.scaleX = mySprite.scaleY = 2;

var props:Rectangle = new Rectangle(mySprite.x, mySprite.y, mySprite.width,
mySprite.height);
trace(mySprite x,y,width,height:  + props);
trace(mySprite.getBounds(mySprite) =  + mySprite.getBounds(mySprite));
trace(mySprite.getBounds(stage) =  + mySprite.getBounds(stage));

var myBounds:Rectangle = mySprite.getBounds(mySprite);
var originOffset:Point = new Point()
originOffset.x = -myBounds.x * mySprite.scaleX
originOffset.y = -myBounds.y * mySprite.scaleY;
mySprite.x = originOffset.x;
mySprite.y = originOffset.y;



On Tue, Aug 2, 2011 at 1:03 AM, nasim h iranebah...@yahoo.com wrote:

 Hi

 Could u help me .  i draw wave( by code) inside empy movieClip that se
 regpoint (manualy)  at middle of that when i scale it t it’s good but
 when i move align x or y It scaled by pevios position  . I want to change
 reg point and refrence point
 too , like when i do it manualy , the refrence point means (0,0) point ,
  how do i change that point plese help me
 what is diferent between reg point and origion point (cordinate system
 (0,0)) And how to change them ?
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




-- 
Ktu;

The information contained in this message may or may not be privileged
and/or confidential. If you are NOT the intended recipient, congratulations,
you got mail!
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Help Registration point and origion point

2011-08-01 Thread nasim hhhhh
Hi

Could u help me .  i draw wave( by code) inside empy movieClip that se 
regpoint (manualy)  at middle of that when i scale it t it’s good but 
when i move align x or y It scaled by pevios position  . I want to change reg 
point and refrence point 
too , like when i do it manualy , the refrence point means (0,0) point ,
 how do i change that point plese help me
what is diferent between reg point and origion point (cordinate system (0,0)) 
And how to change them ?
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Help with code

2011-02-12 Thread Renata
English is not my native language, so I apologize if you make mistakes of 
agreement or spellings.
AS3 study and made this game for three year olds who can notmove with mouse, to 
run it, there is an error and I can not makeit back to the home page.

Below the code and the error message.
I do not know whether you are permitted to place the filesattached so I 
reproduce the code below.

package  
{
//importar classes
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.Timer;
import flash.utils.getDefinitionByName;
import flash.geom.Rectangle;
import flash.sensors.Accelerometer;

public class Bolhas extends MovieClip 
{
var mouse:Mouse1;
var nextObject:Timer;
var nextNivel:Timer;
var objects:Array = new Array();
var score:int = 0;
var nivel:int = 1;
var stopButton:SimpleButton;
const speed:Number = 5.0;
public function Bolhas() {}
public function iniciarJogo():Bolhas {
// constructor code
mouse = new Mouse1();
mouse.y = 550;
addChildAt(mouse,0);
setNextObject();
setNextNivel();
addEventListener(Event.ENTER_FRAME, moveObjects);
/**
 * codigo adicionado
 * coloquei essa parte do startDrag aqui pq isso não tem necessidade de ficar 
em loop
 */
var rectangle:Rectangle = new Rectangle (25,70,750,450);
mouse.startDrag(true, rectangle);
mouse.mouseEnabled = false;
this.mouseEnabled = false;
/** + **/
return this;
jogo.pararJogo(jogo);
}
public function setNextObject() {
nextObject = new Timer(2000-Math.random()*1000,1);
nextObject.addEventListener(TimerEvent.TIMER_COMPLETE,newObject);
nextObject.start();
}
public function setNextNivel() {
nextNivel = new Timer(5,1);
nextNivel.addEventListener(TimerEvent.TIMER,newNivel);
nextNivel.start();
}
public function newObject(e:Event) {
var newObject:MovieClip = new Bolha();
//newObject.x = Math.random() * 500;
newObject.x = (Math.random()*500) + 100;
newObject.y = (Math.random()*100) + 500;
 //newObject.scaleX = (Math.random()*50) + 80;
//newObject.scaleY = newObject.scaleX; 
   addChild(newObject);
objects.push(newObject);
setNextObject();
}
public function newNivel(e:TimerEvent) {
this.nivel++;
//setNextNivel();
}
public function moveObjects(e:Event) {
for(var i:int=objects.length-1;i=0;i--) {
objects[i].y -= speed + nivel * 2;
//if (objects[i].y  500) {
//removeChild(objects[i]);
//objects.splice(i,1);
//}
if (objects[i].hitTestObject(mouse)) {
trace(mouse);
score += 5;
var be:MovieClip = new bolhaEstourada();
be.y = objects[i].y;
be.x = objects[i].x;
removeChild(objects[i]);
addChild(be);
be.gotoAndPlay(2);
objects.splice(i,1);
}
trace(Score: +score);
}
}
public function pararJogo(game:Bolhas){
mouse   = null;
objects = new Array();
nivel   = 1;
score   = 0;
removeChild(game);
}
}
}

TypeError: Error # 2007: Parameter hitTestObject must not be null.
at flash.display:: DisplayObject / _hitTest ()
at flash.display:: DisplayObject / hitTestObject ()
Bubbles at / moveObjects ()

I would like you to show a possible solution to the problem.

Now, thank you.

Renata




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Help with code

2011-02-12 Thread Gerry Beauregard
Hi Renata,

 TypeError: Error # 2007: Parameter hitTestObject must not be null.


The argument to hitTestObject() is 'mouse'.  You get the error because the 
'mouse' argument to hitTestObject() is null.  Since mouse is constructed in 
function iniciarJogo(), my guess is that iniciarJogo() never gets called. An 
easy fix would be to call iniciarJogo from the constructor of the Bolhas class, 
like this:

public function Bolhas()
{
   iniciarJogo();
}

-Gerry



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Help with Image Slideshow - displaying random image

2011-01-20 Thread Christopher Lucas
Many thanks to any and all who respond!! I'm at the extent of my AS skills.
I'd like to make the following image slide show display like it does,
sequentially, as well as making it display random. Anyone know how I can do
that? I've included the code I have working now. Text and image are
displaying fine. I've tried adding a ramdom order, but it breaks the
image/description tie. Again, many thanks to all help...

AS Code:
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;

var my_speed:Number;
var my_total:Number;
var my_images:XMLList;

var my_loaders_array:Array=[];
var my_labels_array:Array=[];
var my_success_counter:Number=0;
var my_playback_counter:Number=0;

var my_slideshow:Sprite = new Sprite();
var my_image_slides:Sprite = new Sprite();
var my_label_slides:Sprite = new Sprite();
var my_preloader:TextField;

var my_timer:Timer;
var my_prev_tween:Tween;
var my_tweens_array:Array=[];

var myFont = new Font1();
var myFormat:TextFormat = new TextFormat();
myFormat.size = 16;
myFormat.font = myFont.fontName;


var my_xml_loader:URLLoader = new URLLoader();
my_xml_loader.load(new URLRequest(offices.xml));
my_xml_loader.addEventListener(Event.COMPLETE, processXML);

function processXML(e:Event):void {
var my_xml:XML=new XML(e.target.data);
my_speed = my_xml.@SPEED;
my_images = my_xml.IMAGE;
my_total = my_images.length();

loadImages();

my_xml_loader.removeEventListener(Event.COMPLETE, processXML);
my_xml_loader=null;
}

function loadImages():void {
for (var i:Number = 0; i  my_total; i++) {
var my_url:String=my_images[i].@SRC;
var my_loader:Loader = new Loader();
my_loader.load(new URLRequest(my_url));
my_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
my_loaders_array.push(my_loader);

var my_label:TextField = new TextField();
my_label.defaultTextFormat = myFormat;
my_label.text=my_images[i].@DESC;
my_label.autoSize=TextFieldAutoSize.CENTER;

my_label.textColor = 00;
my_labels_array.push(my_label);

}

my_preloader = new TextField();
my_preloader.text=Loading;
my_preloader.autoSize=TextFieldAutoSize.CENTER;
// my_preloader.x = (stage.stageWidth - my_preloader.width)/2;
// my_preloader.y = (stage.stageHeight - my_preloader.height)/2;
addChild(my_preloader);

}

function onComplete(e:Event):void {

my_success_counter++;
if (my_success_counter==my_total) {
startShow();
}

var my_loaderInfo:LoaderInfo=LoaderInfo(e.target);
my_loaderInfo.removeEventListener(Event.COMPLETE, onComplete);

}

function startShow():void {

removeChild(my_preloader);
my_preloader=null;

addChild(my_slideshow);
my_slideshow.addChild(my_image_slides);
my_slideshow.addChild(my_label_slides);

nextImage();

my_timer=new Timer(my_speed*1000);
my_timer.addEventListener(TimerEvent.TIMER, timerListener);
my_timer.start();

}

function nextImage():void {

var my_image:Loader=Loader(my_loaders_array[my_playback_counter]);
my_image_slides.addChild(my_image);
// my_image.x = (stage.stageWidth - my_image.width)/2;
// my_image.y = (stage.stageHeight - my_image.height)/2;
my_tweens_array[0]=new Tween(my_image,alpha,Strong.easeOut,0,1,1,true);

var my_label:TextField=TextField(my_labels_array[my_playback_counter]);
my_label_slides.addChild(my_label);
my_label.x = (stage.stageWidth - my_label.width)/2;
my_label.y = 155;
my_tweens_array[1]=new Tween(my_label,alpha,Strong.easeOut,0,1,1,true);

}

function timerListener(e:TimerEvent):void {

hidePrev();

my_playback_counter++;
if (my_playback_counter==my_total) {
my_playback_counter=0;
}
nextImage();

}

function hidePrev():void {

var my_image:Loader=Loader(my_image_slides.getChildAt(0));
my_prev_tween=new Tween(my_image,alpha,Strong.easeOut,1,0,1,true);
my_prev_tween.addEventListener(TweenEvent.MOTION_FINISH, onFadeOut);

var my_label:TextField=TextField(my_label_slides.getChildAt(0));
my_tweens_array[2]=new Tween(my_label,alpha,Strong.easeOut,1,0,1,true);

}

function onFadeOut(e:TweenEvent):void {
my_image_slides.removeChildAt(0);
my_label_slides.removeChildAt(0);
}

Part of XML:
?xml version=1.0 encoding=utf-8?
SLIDESHOW SPEED=2
IMAGE SRC=images1.jpg DESC=Rome/
IMAGE SRC=images2.jpg DESC=Paris/
IMAGE SRC=images3.jpg DESC=Cairo/
IMAGE SRC=images4.jpg DESC=London/
IMAGE SRC=images5.jpg DESC=New Yor City/
/SLIDESHOW
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Help with Image Slideshow - displaying random image

2011-01-20 Thread Anthony Pace

It seems to be your listeners and the order of the Complete events.


On 1/20/2011 11:19 AM, Christopher Lucas wrote:

any thanks to any and all who respond!! I'm at the extent of my AS skills.
I'd like to make the following image slide show display like it does,
sequentially, as well as making it display random. Anyone know how I can do
that? I've included the code I have working now. Text and image are
displaying fine. I've tried adding a ramdom order, but it br


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Help with Image Slideshow - displaying random image

2011-01-20 Thread Anthony Pace
If you want them to be random, take the xml as an array, and then do a 
random swap for each node.

(I think someone posted some code for the proper way to shuffle an array.)

then load the images in that order.



\On 1/20/2011 12:44 PM, Anthony Pace wrote:

It seems to be your listeners and the order of the Complete events.


On 1/20/2011 11:19 AM, Christopher Lucas wrote:
any thanks to any and all who respond!! I'm at the extent of my AS 
skills.

I'd like to make the following image slide show display like it does,
sequentially, as well as making it display random. Anyone know how I 
can do

that? I've included the code I have working now. Text and image are
displaying fine. I've tried adding a ramdom order, but it br


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Help with Image Slideshow - displaying random image

2011-01-20 Thread Anthony Pace
sorry if my first response seemed a bit cheeky... truth is I posted my 
response based on the subject of your post, and then I posted my second 
response, after actually reading it... kind of a cart before the horse 
scenario.


On 1/20/2011 12:44 PM, Anthony Pace wrote:

It seems to be your listeners and the order of the Complete events.


On 1/20/2011 11:19 AM, Christopher Lucas wrote:
any thanks to any and all who respond!! I'm at the extent of my AS 
skills.

I'd like to make the following image slide show display like it does,
sequentially, as well as making it display random. Anyone know how I 
can do

that? I've included the code I have working now. Text and image are
displaying fine. I've tried adding a ramdom order, but it br


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Help with addChild

2010-07-16 Thread Henrik Andersson

Deepanjan Das wrote:

Hi,
I think the stage has not yet been initiated, hence the addChild is not
working.
Try to get hold of the stage first and then so an addChild.


While that is indeed a common problem, it is not the current problem. He 
is adding to the main timeline, not the stage.

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Help with addChild

2010-07-16 Thread J.C. Berry
You are right. But do you know what it could be, Henrik? Do you need to see
some more code?

On Fri, Jul 16, 2010 at 1:34 AM, Henrik Andersson he...@henke37.cjb.netwrote:

 Deepanjan Das wrote:

 Hi,
 I think the stage has not yet been initiated, hence the addChild is not
 working.
 Try to get hold of the stage first and then so an addChild.


 While that is indeed a common problem, it is not the current problem. He is
 adding to the main timeline, not the stage.

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




-- 
J.C. Berry, M.A.
UI Developer
619.306.1712(m)
jcharlesbe...@gmail.com
portfolio: http://Client:maz...@www.mindarc.com


This E-mail is covered by the Electronic Communications Privacy Act, 18
U.S.C. ?? 2510-2521 and is legally privileged. This information is
confidential information and is intended only for the use of the individual
or entity named above. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Help with addChild

2010-07-16 Thread Eric E. Dolecki
I lost the thread to this, but he is adding it to the document class if I
remember correctly. I think we'd need to see a little code again J.C.

On Fri, Jul 16, 2010 at 3:07 PM, J.C. Berry jcharlesbe...@gmail.com wrote:

 You are right. But do you know what it could be, Henrik? Do you need to see
 some more code?

 On Fri, Jul 16, 2010 at 1:34 AM, Henrik Andersson he...@henke37.cjb.net
 wrote:

  Deepanjan Das wrote:
 
  Hi,
  I think the stage has not yet been initiated, hence the addChild is not
  working.
  Try to get hold of the stage first and then so an addChild.
 
 
  While that is indeed a common problem, it is not the current problem. He
 is
  adding to the main timeline, not the stage.
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 



 --
 J.C. Berry, M.A.
 UI Developer
 619.306.1712(m)
 jcharlesbe...@gmail.com
 portfolio: http://Client:maz...@www.mindarc.com

 

 This E-mail is covered by the Electronic Communications Privacy Act, 18
 U.S.C. ?? 2510-2521 and is legally privileged. This information is
 confidential information and is intended only for the use of the individual
 or entity named above. If the reader of this message is not the intended
 recipient, you are hereby notified that any dissemination, distribution or
 copying of this communication is strictly prohibited.

 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




-- 
http://ericd.net
Interactive design and development
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Help with addChild

2010-07-16 Thread Mattheis, Erik (MIN-WSW)
Yes, more code please.

_ _ _
Erik Mattheis
Senior Web Developer
Minneapolis
T  952 346 6610
C 612 377 2272

Weber Shandwick
Advocacy starts here.

PRWeek Global Agency Report Card 2009 - Gold Medal Winner
The Holmes Report Global Agency of the Year
PR News Agency of the Year


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com 
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of J.C. Berry
Sent: Friday, July 16, 2010 2:08 PM
To: Flash Coders List
Subject: Re: [Flashcoders] Help with addChild

You are right. But do you know what it could be, Henrik? Do you need to see
some more code?

On Fri, Jul 16, 2010 at 1:34 AM, Henrik Andersson he...@henke37.cjb.netwrote:

 Deepanjan Das wrote:

 Hi,
 I think the stage has not yet been initiated, hence the addChild is not
 working.
 Try to get hold of the stage first and then so an addChild.


 While that is indeed a common problem, it is not the current problem. He is
 adding to the main timeline, not the stage.

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




-- 
J.C. Berry, M.A.
UI Developer
619.306.1712(m)
jcharlesbe...@gmail.com
portfolio: http://Client:maz...@www.mindarc.com


This E-mail is covered by the Electronic Communications Privacy Act, 18
U.S.C. ?? 2510-2521 and is legally privileged. This information is
confidential information and is intended only for the use of the individual
or entity named above. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Help with addChild

2010-07-16 Thread J.C. Berry
From separate class:
var myPopout:myPopout = new myPopout(e.target,this.btnNum,this.cityList);
//Calls below

From other class:

public function myPopout(stageBtn,btnNum,cityList){//constructor
this.btnNum = btnNum;
this.cityList = cityList;
this.stageBtn = stageBtn;
initPopout(stageBtn,btnNum,cityList);
}

public function initPopout(stageBtn,btnNum,cityList){
if(btnNum  25){
trace(this);
var popInstance:Tba = new Tba();
popInstance.x = 10;
popInstance.y = 10;
popInstance.name = 'cityPopout'+btnNum+'_mc';
popInstance.alpha = 1;
addChild(popInstance);//no error or result

So here it only works if I use stageBtn.addChild(popInstance)





On Fri, Jul 16, 2010 at 12:33 PM, Mattheis, Erik (MIN-WSW) 
ematth...@webershandwick.com wrote:

 Yes, more code please.

 _ _ _
 Erik Mattheis
 Senior Web Developer
 Minneapolis
 T  952 346 6610
 C 612 377 2272

 Weber Shandwick
 Advocacy starts here.

 PRWeek Global Agency Report Card 2009 - Gold Medal Winner
 The Holmes Report Global Agency of the Year
 PR News Agency of the Year


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
 flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of J.C. Berry
 Sent: Friday, July 16, 2010 2:08 PM
 To: Flash Coders List
 Subject: Re: [Flashcoders] Help with addChild

 You are right. But do you know what it could be, Henrik? Do you need to see
 some more code?

 On Fri, Jul 16, 2010 at 1:34 AM, Henrik Andersson he...@henke37.cjb.net
 wrote:

  Deepanjan Das wrote:
 
  Hi,
  I think the stage has not yet been initiated, hence the addChild is not
  working.
  Try to get hold of the stage first and then so an addChild.
 
 
  While that is indeed a common problem, it is not the current problem. He
 is
  adding to the main timeline, not the stage.
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 



 --
 J.C. Berry, M.A.
 UI Developer
 619.306.1712(m)
 jcharlesbe...@gmail.com
 portfolio: http://Client:maz...@www.mindarc.com

 

 This E-mail is covered by the Electronic Communications Privacy Act, 18
 U.S.C. ?? 2510-2521 and is legally privileged. This information is
 confidential information and is intended only for the use of the individual
 or entity named above. If the reader of this message is not the intended
 recipient, you are hereby notified that any dissemination, distribution or
 copying of this communication is strictly prohibited.

 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




-- 
J.C. Berry, M.A.
UI Developer
619.306.1712(m)
jcharlesbe...@gmail.com
portfolio: http://Client:maz...@www.mindarc.com


This E-mail is covered by the Electronic Communications Privacy Act, 18
U.S.C. ?? 2510-2521 and is legally privileged. This information is
confidential information and is intended only for the use of the individual
or entity named above. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Help with addChild

2010-07-16 Thread Eric E. Dolecki
I don't think this is enough code... myPopout extends Sprite or MovieClip or
something?
What if in your other class you did this:

var myPopout:myPopout = new myPopout(e.target,this.btnNum,this.cityList);
addChild(myPopout);

?

I don't think we know enough about what you are doing...


On Fri, Jul 16, 2010 at 3:40 PM, J.C. Berry jcharlesbe...@gmail.com wrote:

 From separate class:
 var myPopout:myPopout = new myPopout(e.target,this.btnNum,this.cityList);
 //Calls below

 From other class:

 public function myPopout(stageBtn,btnNum,cityList){//constructor
this.btnNum = btnNum;
this.cityList = cityList;
this.stageBtn = stageBtn;
initPopout(stageBtn,btnNum,cityList);
}

 public function initPopout(stageBtn,btnNum,cityList){
if(btnNum  25){
trace(this);
var popInstance:Tba = new Tba();
popInstance.x = 10;
popInstance.y = 10;
popInstance.name = 'cityPopout'+btnNum+'_mc';
popInstance.alpha = 1;
addChild(popInstance);//no error or result

 So here it only works if I use stageBtn.addChild(popInstance)





 On Fri, Jul 16, 2010 at 12:33 PM, Mattheis, Erik (MIN-WSW) 
 ematth...@webershandwick.com wrote:

  Yes, more code please.
 
  _ _ _
  Erik Mattheis
  Senior Web Developer
  Minneapolis
  T  952 346 6610
  C 612 377 2272
 
  Weber Shandwick
  Advocacy starts here.
 
  PRWeek Global Agency Report Card 2009 - Gold Medal Winner
  The Holmes Report Global Agency of the Year
  PR News Agency of the Year
 
 
  -Original Message-
  From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
  flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of J.C. Berry
  Sent: Friday, July 16, 2010 2:08 PM
  To: Flash Coders List
  Subject: Re: [Flashcoders] Help with addChild
 
  You are right. But do you know what it could be, Henrik? Do you need to
 see
  some more code?
 
  On Fri, Jul 16, 2010 at 1:34 AM, Henrik Andersson he...@henke37.cjb.net
  wrote:
 
   Deepanjan Das wrote:
  
   Hi,
   I think the stage has not yet been initiated, hence the addChild is
 not
   working.
   Try to get hold of the stage first and then so an addChild.
  
  
   While that is indeed a common problem, it is not the current problem.
 He
  is
   adding to the main timeline, not the stage.
  
   ___
   Flashcoders mailing list
   Flashcoders@chattyfig.figleaf.com
   http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
  
 
 
 
  --
  J.C. Berry, M.A.
  UI Developer
  619.306.1712(m)
  jcharlesbe...@gmail.com
  portfolio: http://Client:maz...@www.mindarc.com
 
 
 
 
  This E-mail is covered by the Electronic Communications Privacy Act, 18
  U.S.C. ?? 2510-2521 and is legally privileged. This information is
  confidential information and is intended only for the use of the
 individual
  or entity named above. If the reader of this message is not the intended
  recipient, you are hereby notified that any dissemination, distribution
 or
  copying of this communication is strictly prohibited.
 
 
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 



 --
 J.C. Berry, M.A.
 UI Developer
 619.306.1712(m)
 jcharlesbe...@gmail.com
 portfolio: http://Client:maz...@www.mindarc.com

 

 This E-mail is covered by the Electronic Communications Privacy Act, 18
 U.S.C. ?? 2510-2521 and is legally privileged. This information is
 confidential information and is intended only for the use of the individual
 or entity named above. If the reader of this message is not the intended
 recipient, you are hereby notified that any dissemination, distribution or
 copying of this communication is strictly prohibited.

 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




-- 
http://ericd.net
Interactive design and development
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com

Re: [Flashcoders] Help with addChild

2010-07-16 Thread J.C. Berry
MYMAP DOC CLASS-
package{
import fl.controls.TextArea;
import fl.containers.ScrollPane;
import fl.controls.Button;
import flash.display.*;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.net.URLLoader;
import fl.managers.StyleManager;

public class myMap extends MovieClip{
public var cityList:XMLList;

public function myMap(){
/*for each(var num:String in args){...args
trace(num);
}*/
var myXMLLoaderReq:URLRequest = new URLRequest('cities.xml');
var myXMLLoader:URLLoader = new URLLoader(myXMLLoaderReq);
//XML.ignoreWhitespace = false;
myXMLLoader.addEventListener(Event.COMPLETE, xmlLoaded);
}
public function xmlLoaded(e:Event){
var myBtnArr:Array = [];
var myXML:XML = new XML(e.target.data);
cityList = new XMLList(myXML.city);
var numOfCities:Number = cityList.length();
for(var i=0;inumOfCities;i++){
var myStageSetter:myButtonInstantor = new
myButtonInstantor();

myStageSetter.getButtonInstance(this.getChildByName('city'+i+'_mc'),i,cityList);
myBtnArr.push(myStageSetter);
}
e.target.removeEventListener(Event.COMPLETE, xmlLoaded);
}
}
}


MYMAP DOCUMENT CLASS CALLS-
package{
import flash.display.*;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.text.TextField;
import flash.text.TextFormat;
import fl.controls.Button;

public class myButtonInstantor extends MovieClip{
public var btnNum:Number;
public var btnName:String;
public var cityList:XMLList;
public function myButtonInstantor(){
}
public function getButtonInstance(obj,btnNum,cityList):MovieClip{
this.btnNum = btnNum;
this.cityList = cityList;
obj.gotoAndStop(1);

obj.addEventListener(MouseEvent.MOUSE_OVER,myBtnRollOverHandler);
obj.addEventListener(MouseEvent.MOUSE_OUT,myBtnRollOutHandler);
return this;
}
private function myBtnRollOutHandler(e:Event):void{
e.target.gotoAndStop(1);
}
public function myBtnRollOverHandler(e:Event):void{
e.target.gotoAndStop(2);
for (var k:int = 0; k  this.numChildren; k++){
if(this.getChildAt(k).name.indexOf('Popout')-1 ||
this.getChildAt(k).name.indexOf('myTextBox')-1){
this.removeChildAt(k);
}
}
var myPopoutObj:myPopout = new
myPopout(e.target,this.btnNum,this.cityList);
addChild(myPopoutObj);//Does not work either


MYBUTTONINSTANTOR CALLS-
package{
import fl.controls.TextArea;
import fl.controls.Button;
import fl.containers.ScrollPane;
import flash.display.*;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.net.URLLoader;
import fl.managers.StyleManager;

public class myPopout extends MovieClip{
public var cityList:XMLList;
public var btnNum:Number;
public var stageBtn;


//public var popInstance:Tba = new Tba();
public var popInstance2:Tba2 = new Tba2();

public function myPopout(stageBtn,btnNum,cityList){
this.btnNum = btnNum;
this.cityList = cityList;
this.stageBtn = stageBtn;
initPopout(stageBtn,btnNum,cityList);
}
public function initPopout(stageBtn,btnNum,cityList){
if(btnNum  25){
trace(this);
var popInstance:Tba = new Tba();
popInstance.x = 10;
popInstance.y = 10;
popInstance.name = 'cityPopout'+btnNum+'_mc';
popInstance.alpha = 1;
addChild(popInstance); //broken here
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Help with addChild

2010-07-16 Thread Mattheis, Erik (MIN-WSW)
I'd guess your other class is not in the display list. Do you say 
addChild(OtherClass) anywhere?

_ _ _
Erik Mattheis
Senior Web Developer
Minneapolis
T  952 346 6610
C 612 377 2272

Weber Shandwick
Advocacy starts here.

PRWeek Global Agency Report Card 2009 - Gold Medal Winner
The Holmes Report Global Agency of the Year
PR News Agency of the Year


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com 
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of J.C. Berry
Sent: Friday, July 16, 2010 2:40 PM
To: Flash Coders List
Subject: Re: [Flashcoders] Help with addChild

From separate class:
var myPopout:myPopout = new myPopout(e.target,this.btnNum,this.cityList);
//Calls below

From other class:

public function myPopout(stageBtn,btnNum,cityList){//constructor
this.btnNum = btnNum;
this.cityList = cityList;
this.stageBtn = stageBtn;
initPopout(stageBtn,btnNum,cityList);
}

public function initPopout(stageBtn,btnNum,cityList){
if(btnNum  25){
trace(this);
var popInstance:Tba = new Tba();
popInstance.x = 10;
popInstance.y = 10;
popInstance.name = 'cityPopout'+btnNum+'_mc';
popInstance.alpha = 1;
addChild(popInstance);//no error or result

So here it only works if I use stageBtn.addChild(popInstance)





On Fri, Jul 16, 2010 at 12:33 PM, Mattheis, Erik (MIN-WSW) 
ematth...@webershandwick.com wrote:

 Yes, more code please.

 _ _ _
 Erik Mattheis
 Senior Web Developer
 Minneapolis
 T  952 346 6610
 C 612 377 2272

 Weber Shandwick
 Advocacy starts here.

 PRWeek Global Agency Report Card 2009 - Gold Medal Winner
 The Holmes Report Global Agency of the Year
 PR News Agency of the Year


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
 flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of J.C. Berry
 Sent: Friday, July 16, 2010 2:08 PM
 To: Flash Coders List
 Subject: Re: [Flashcoders] Help with addChild

 You are right. But do you know what it could be, Henrik? Do you need to see
 some more code?

 On Fri, Jul 16, 2010 at 1:34 AM, Henrik Andersson he...@henke37.cjb.net
 wrote:

  Deepanjan Das wrote:
 
  Hi,
  I think the stage has not yet been initiated, hence the addChild is not
  working.
  Try to get hold of the stage first and then so an addChild.
 
 
  While that is indeed a common problem, it is not the current problem. He
 is
  adding to the main timeline, not the stage.
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 



 --
 J.C. Berry, M.A.
 UI Developer
 619.306.1712(m)
 jcharlesbe...@gmail.com
 portfolio: http://Client:maz...@www.mindarc.com

 

 This E-mail is covered by the Electronic Communications Privacy Act, 18
 U.S.C. ?? 2510-2521 and is legally privileged. This information is
 confidential information and is intended only for the use of the individual
 or entity named above. If the reader of this message is not the intended
 recipient, you are hereby notified that any dissemination, distribution or
 copying of this communication is strictly prohibited.

 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




-- 
J.C. Berry, M.A.
UI Developer
619.306.1712(m)
jcharlesbe...@gmail.com
portfolio: http://Client:maz...@www.mindarc.com


This E-mail is covered by the Electronic Communications Privacy Act, 18
U.S.C. ?? 2510-2521 and is legally privileged. This information is
confidential information and is intended only for the use of the individual
or entity named above. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders

Re: [Flashcoders] Help with addChild

2010-07-16 Thread J.C. Berry
public function initPopout(stageBtn,btnNum,
cityList){
if(btnNum  25){
trace(this);
var popInstance:Tba = new Tba();
popInstance.x = 10;
popInstance.y = 10;
popInstance.name = 'cityPopout'+btnNum+'_mc';
popInstance.alpha = 1;
addChild(popInstance);//no error or result

Yes, the last line in my other class (addChild(popInstance);)  adds the
Tba instance, but it only works if I use one of the buttons on stage. How do
I add a class (myPopout) to the stage?


On Fri, Jul 16, 2010 at 1:03 PM, Mattheis, Erik (MIN-WSW) 
ematth...@webershandwick.com wrote:

 I'd guess your other class is not in the display list. Do you say
 addChild(OtherClass) anywhere?

 _ _ _
 Erik Mattheis
 Senior Web Developer
 Minneapolis
 T  952 346 6610
 C 612 377 2272

 Weber Shandwick
 Advocacy starts here.

 PRWeek Global Agency Report Card 2009 - Gold Medal Winner
 The Holmes Report Global Agency of the Year
 PR News Agency of the Year


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
 flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of J.C. Berry
 Sent: Friday, July 16, 2010 2:40 PM
 To: Flash Coders List
 Subject: Re: [Flashcoders] Help with addChild

 From separate class:
 var myPopout:myPopout = new myPopout(e.target,this.btnNum,this.cityList);
 //Calls below

 From other class:

 public function myPopout(stageBtn,btnNum,cityList){//constructor
this.btnNum = btnNum;
this.cityList = cityList;
this.stageBtn = stageBtn;
initPopout(stageBtn,btnNum,cityList);
}

 public function initPopout(stageBtn,btnNum,cityList){
if(btnNum  25){
trace(this);
var popInstance:Tba = new Tba();
popInstance.x = 10;
popInstance.y = 10;
popInstance.name = 'cityPopout'+btnNum+'_mc';
popInstance.alpha = 1;
addChild(popInstance);//no error or result

 So here it only works if I use stageBtn.addChild(popInstance)





 On Fri, Jul 16, 2010 at 12:33 PM, Mattheis, Erik (MIN-WSW) 
 ematth...@webershandwick.com wrote:

  Yes, more code please.
 
  _ _ _
  Erik Mattheis
  Senior Web Developer
  Minneapolis
  T  952 346 6610
  C 612 377 2272
 
  Weber Shandwick
  Advocacy starts here.
 
  PRWeek Global Agency Report Card 2009 - Gold Medal Winner
  The Holmes Report Global Agency of the Year
  PR News Agency of the Year
 
 
  -Original Message-
  From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
  flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of J.C. Berry
  Sent: Friday, July 16, 2010 2:08 PM
  To: Flash Coders List
  Subject: Re: [Flashcoders] Help with addChild
 
  You are right. But do you know what it could be, Henrik? Do you need to
 see
  some more code?
 
  On Fri, Jul 16, 2010 at 1:34 AM, Henrik Andersson he...@henke37.cjb.net
  wrote:
 
   Deepanjan Das wrote:
  
   Hi,
   I think the stage has not yet been initiated, hence the addChild is
 not
   working.
   Try to get hold of the stage first and then so an addChild.
  
  
   While that is indeed a common problem, it is not the current problem.
 He
  is
   adding to the main timeline, not the stage.
  
   ___
   Flashcoders mailing list
   Flashcoders@chattyfig.figleaf.com
   http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
  
 
 
 
  --
  J.C. Berry, M.A.
  UI Developer
  619.306.1712(m)
  jcharlesbe...@gmail.com
  portfolio: http://Client:maz...@www.mindarc.com
 
 
 
 
  This E-mail is covered by the Electronic Communications Privacy Act, 18
  U.S.C. ?? 2510-2521 and is legally privileged. This information is
  confidential information and is intended only for the use of the
 individual
  or entity named above. If the reader of this message is not the intended
  recipient, you are hereby notified that any dissemination, distribution
 or
  copying of this communication is strictly prohibited.
 
 
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 



 --
 J.C. Berry, M.A.
 UI Developer
 619.306.1712(m)
 jcharlesbe...@gmail.com
 portfolio: http://Client:maz...@www.mindarc.com

RE: [Flashcoders] Help with addChild

2010-07-16 Thread Mattheis, Erik (MIN-WSW)
If you're creating myPopout from within the document class or any other class 
that has been added to the stage, you would say

_myPopout = new myPopout();
addChild(_myPopout);

_ _ _
Erik Mattheis
Senior Web Developer
Minneapolis
T  952 346 6610
C 612 377 2272

Weber Shandwick
Advocacy starts here.

PRWeek Global Agency Report Card 2009 - Gold Medal Winner
The Holmes Report Global Agency of the Year
PR News Agency of the Year


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com 
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of J.C. Berry
Sent: Friday, July 16, 2010 3:14 PM
To: Flash Coders List
Subject: Re: [Flashcoders] Help with addChild

public function initPopout(stageBtn,btnNum,
cityList){
if(btnNum  25){
trace(this);
var popInstance:Tba = new Tba();
popInstance.x = 10;
popInstance.y = 10;
popInstance.name = 'cityPopout'+btnNum+'_mc';
popInstance.alpha = 1;
addChild(popInstance);//no error or result

Yes, the last line in my other class (addChild(popInstance);)  adds the
Tba instance, but it only works if I use one of the buttons on stage. How do
I add a class (myPopout) to the stage?


On Fri, Jul 16, 2010 at 1:03 PM, Mattheis, Erik (MIN-WSW) 
ematth...@webershandwick.com wrote:

 I'd guess your other class is not in the display list. Do you say
 addChild(OtherClass) anywhere?

 _ _ _
 Erik Mattheis
 Senior Web Developer
 Minneapolis
 T  952 346 6610
 C 612 377 2272

 Weber Shandwick
 Advocacy starts here.

 PRWeek Global Agency Report Card 2009 - Gold Medal Winner
 The Holmes Report Global Agency of the Year
 PR News Agency of the Year


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
 flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of J.C. Berry
 Sent: Friday, July 16, 2010 2:40 PM
 To: Flash Coders List
 Subject: Re: [Flashcoders] Help with addChild

 From separate class:
 var myPopout:myPopout = new myPopout(e.target,this.btnNum,this.cityList);
 //Calls below

 From other class:

 public function myPopout(stageBtn,btnNum,cityList){//constructor
this.btnNum = btnNum;
this.cityList = cityList;
this.stageBtn = stageBtn;
initPopout(stageBtn,btnNum,cityList);
}

 public function initPopout(stageBtn,btnNum,cityList){
if(btnNum  25){
trace(this);
var popInstance:Tba = new Tba();
popInstance.x = 10;
popInstance.y = 10;
popInstance.name = 'cityPopout'+btnNum+'_mc';
popInstance.alpha = 1;
addChild(popInstance);//no error or result

 So here it only works if I use stageBtn.addChild(popInstance)





 On Fri, Jul 16, 2010 at 12:33 PM, Mattheis, Erik (MIN-WSW) 
 ematth...@webershandwick.com wrote:

  Yes, more code please.
 
  _ _ _
  Erik Mattheis
  Senior Web Developer
  Minneapolis
  T  952 346 6610
  C 612 377 2272
 
  Weber Shandwick
  Advocacy starts here.
 
  PRWeek Global Agency Report Card 2009 - Gold Medal Winner
  The Holmes Report Global Agency of the Year
  PR News Agency of the Year
 
 
  -Original Message-
  From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
  flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of J.C. Berry
  Sent: Friday, July 16, 2010 2:08 PM
  To: Flash Coders List
  Subject: Re: [Flashcoders] Help with addChild
 
  You are right. But do you know what it could be, Henrik? Do you need to
 see
  some more code?
 
  On Fri, Jul 16, 2010 at 1:34 AM, Henrik Andersson he...@henke37.cjb.net
  wrote:
 
   Deepanjan Das wrote:
  
   Hi,
   I think the stage has not yet been initiated, hence the addChild is
 not
   working.
   Try to get hold of the stage first and then so an addChild.
  
  
   While that is indeed a common problem, it is not the current problem.
 He
  is
   adding to the main timeline, not the stage.
  
   ___
   Flashcoders mailing list
   Flashcoders@chattyfig.figleaf.com
   http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
  
 
 
 
  --
  J.C. Berry, M.A.
  UI Developer
  619.306.1712(m)
  jcharlesbe...@gmail.com
  portfolio: http://Client:maz...@www.mindarc.com
 
 
 
 
  This E-mail is covered by the Electronic Communications Privacy Act, 18
  U.S.C. ?? 2510-2521 and is legally privileged. This information is
  confidential information and is intended only for the use of the
 individual
  or entity named above. If the reader of this message is not the intended
  recipient, you are hereby notified that any dissemination, distribution
 or
  copying of this communication is strictly prohibited

Re: [Flashcoders] Help with addChild

2010-07-16 Thread J.C. Berry
Didn't I try that with
var myPopoutObj:myPopout = new myPopout(e.target,this.btnNum,
this.cityList);
addChild(myPopoutObj);//Does not work either

? Help to be appreciated!



On Fri, Jul 16, 2010 at 2:13 PM, Mattheis, Erik (MIN-WSW) 
ematth...@webershandwick.com wrote:

 If you're creating myPopout from within the document class or any other
 class that has been added to the stage, you would say

 _myPopout = new myPopout();
 addChild(_myPopout);

 _ _ _
 Erik Mattheis
 Senior Web Developer
 Minneapolis
 T  952 346 6610
 C 612 377 2272

 Weber Shandwick
 Advocacy starts here.

 PRWeek Global Agency Report Card 2009 - Gold Medal Winner
 The Holmes Report Global Agency of the Year
 PR News Agency of the Year


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
 flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of J.C. Berry
 Sent: Friday, July 16, 2010 3:14 PM
 To: Flash Coders List
 Subject: Re: [Flashcoders] Help with addChild

 public function initPopout(stageBtn,btnNum,
 cityList){
if(btnNum  25){
trace(this);
var popInstance:Tba = new Tba();
popInstance.x = 10;
popInstance.y = 10;
popInstance.name = 'cityPopout'+btnNum+'_mc';
popInstance.alpha = 1;
addChild(popInstance);//no error or result

 Yes, the last line in my other class (addChild(popInstance);)  adds the
 Tba instance, but it only works if I use one of the buttons on stage. How
 do
 I add a class (myPopout) to the stage?


 On Fri, Jul 16, 2010 at 1:03 PM, Mattheis, Erik (MIN-WSW) 
 ematth...@webershandwick.com wrote:

  I'd guess your other class is not in the display list. Do you say
  addChild(OtherClass) anywhere?
 
  _ _ _
  Erik Mattheis
  Senior Web Developer
  Minneapolis
  T  952 346 6610
  C 612 377 2272
 
  Weber Shandwick
  Advocacy starts here.
 
  PRWeek Global Agency Report Card 2009 - Gold Medal Winner
  The Holmes Report Global Agency of the Year
  PR News Agency of the Year
 
 
  -Original Message-
  From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
  flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of J.C. Berry
  Sent: Friday, July 16, 2010 2:40 PM
  To: Flash Coders List
  Subject: Re: [Flashcoders] Help with addChild
 
  From separate class:
  var myPopout:myPopout = new myPopout(e.target,this.btnNum,this.cityList);
  //Calls below
 
  From other class:
 
  public function myPopout(stageBtn,btnNum,cityList){//constructor
 this.btnNum = btnNum;
 this.cityList = cityList;
 this.stageBtn = stageBtn;
 initPopout(stageBtn,btnNum,cityList);
 }
 
  public function initPopout(stageBtn,btnNum,cityList){
 if(btnNum  25){
 trace(this);
 var popInstance:Tba = new Tba();
 popInstance.x = 10;
 popInstance.y = 10;
 popInstance.name = 'cityPopout'+btnNum+'_mc';
 popInstance.alpha = 1;
 addChild(popInstance);//no error or result
 
  So here it only works if I use stageBtn.addChild(popInstance)
 
 
 
 
 
  On Fri, Jul 16, 2010 at 12:33 PM, Mattheis, Erik (MIN-WSW) 
  ematth...@webershandwick.com wrote:
 
   Yes, more code please.
  
   _ _ _
   Erik Mattheis
   Senior Web Developer
   Minneapolis
   T  952 346 6610
   C 612 377 2272
  
   Weber Shandwick
   Advocacy starts here.
  
   PRWeek Global Agency Report Card 2009 - Gold Medal Winner
   The Holmes Report Global Agency of the Year
   PR News Agency of the Year
  
  
   -Original Message-
   From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
   flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of J.C. Berry
   Sent: Friday, July 16, 2010 2:08 PM
   To: Flash Coders List
   Subject: Re: [Flashcoders] Help with addChild
  
   You are right. But do you know what it could be, Henrik? Do you need to
  see
   some more code?
  
   On Fri, Jul 16, 2010 at 1:34 AM, Henrik Andersson 
 he...@henke37.cjb.net
   wrote:
  
Deepanjan Das wrote:
   
Hi,
I think the stage has not yet been initiated, hence the addChild is
  not
working.
Try to get hold of the stage first and then so an addChild.
   
   
While that is indeed a common problem, it is not the current problem.
  He
   is
adding to the main timeline, not the stage.
   
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
   
  
  
  
   --
   J.C. Berry, M.A.
   UI Developer
   619.306.1712(m)
   jcharlesbe...@gmail.com
   portfolio: http://Client:maz...@www.mindarc.com
  
  
 
 
  
   This E-mail is covered by the Electronic Communications Privacy Act, 18
   U.S.C. ?? 2510

Re: [Flashcoders] Help with addChild

2010-07-16 Thread Karl DeSaulniers

Hi JC,
I think this should be

var myPopoutObj = new myPopout(e.target,this.btnNum,

Per his example. Not positive if it matters, but I have had experience
with strong typing voiding out an array and when I took off  
the :Array it worked.

Not sure why. Just a thought.


Karl


On Jul 16, 2010, at 4:49 PM, J.C. Berry wrote:


Didn't I try that with
var myPopoutObj:myPopout = new myPopout(e.target,this.btnNum,
this.cityList);
addChild(myPopoutObj);//Does not work either

? Help to be appreciated!



On Fri, Jul 16, 2010 at 2:13 PM, Mattheis, Erik (MIN-WSW) 
ematth...@webershandwick.com wrote:

If you're creating myPopout from within the document class or any  
other

class that has been added to the stage, you would say

_myPopout = new myPopout();
addChild(_myPopout);

_ _ _
Erik Mattheis
Senior Web Developer
Minneapolis
T  952 346 6610
C 612 377 2272

Weber Shandwick
Advocacy starts here.

PRWeek Global Agency Report Card 2009 - Gold Medal Winner
The Holmes Report Global Agency of the Year
PR News Agency of the Year


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of J.C. Berry
Sent: Friday, July 16, 2010 3:14 PM
To: Flash Coders List
Subject: Re: [Flashcoders] Help with addChild

public function initPopout(stageBtn,btnNum,
cityList){
   if(btnNum  25){
   trace(this);
   var popInstance:Tba = new Tba();
   popInstance.x = 10;
   popInstance.y = 10;
   popInstance.name = 'cityPopout'+btnNum+'_mc';
   popInstance.alpha = 1;
   addChild(popInstance);//no error or result

Yes, the last line in my other class (addChild(popInstance);)   
adds the
Tba instance, but it only works if I use one of the buttons on  
stage. How

do
I add a class (myPopout) to the stage?


On Fri, Jul 16, 2010 at 1:03 PM, Mattheis, Erik (MIN-WSW) 
ematth...@webershandwick.com wrote:


I'd guess your other class is not in the display list. Do you say
addChild(OtherClass) anywhere?

_ _ _
Erik Mattheis
Senior Web Developer
Minneapolis
T  952 346 6610
C 612 377 2272

Weber Shandwick
Advocacy starts here.

PRWeek Global Agency Report Card 2009 - Gold Medal Winner
The Holmes Report Global Agency of the Year
PR News Agency of the Year


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of J.C. Berry
Sent: Friday, July 16, 2010 2:40 PM
To: Flash Coders List
Subject: Re: [Flashcoders] Help with addChild


From separate class:
var myPopout:myPopout = new myPopout 
(e.target,this.btnNum,this.cityList);

//Calls below


From other class:


public function myPopout(stageBtn,btnNum,cityList){//constructor
   this.btnNum = btnNum;
   this.cityList = cityList;
   this.stageBtn = stageBtn;
   initPopout(stageBtn,btnNum,cityList);
   }

public function initPopout(stageBtn,btnNum,cityList){
   if(btnNum  25){
   trace(this);
   var popInstance:Tba = new Tba();
   popInstance.x = 10;
   popInstance.y = 10;
   popInstance.name = 'cityPopout'+btnNum+'_mc';
   popInstance.alpha = 1;
   addChild(popInstance);//no error or result

So here it only works if I use stageBtn.addChild(popInstance)





On Fri, Jul 16, 2010 at 12:33 PM, Mattheis, Erik (MIN-WSW) 
ematth...@webershandwick.com wrote:


Yes, more code please.

_ _ _
Erik Mattheis
Senior Web Developer
Minneapolis
T  952 346 6610
C 612 377 2272

Weber Shandwick
Advocacy starts here.

PRWeek Global Agency Report Card 2009 - Gold Medal Winner
The Holmes Report Global Agency of the Year
PR News Agency of the Year


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of J.C. Berry
Sent: Friday, July 16, 2010 2:08 PM
To: Flash Coders List
Subject: Re: [Flashcoders] Help with addChild

You are right. But do you know what it could be, Henrik? Do you  
need to

see

some more code?

On Fri, Jul 16, 2010 at 1:34 AM, Henrik Andersson 

he...@henke37.cjb.net

wrote:



Deepanjan Das wrote:


Hi,
I think the stage has not yet been initiated, hence the  
addChild is

not

working.
Try to get hold of the stage first and then so an addChild.



While that is indeed a common problem, it is not the current  
problem.

He

is

adding to the main timeline, not the stage.

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders





--
J.C. Berry, M.A.
UI Developer
619.306.1712(m)
jcharlesbe...@gmail.com
portfolio: http://Client:maz...@www.mindarc.com




- 
- 
--


This E-mail is covered

Re: [Flashcoders] Help with addChild

2010-07-16 Thread J.C. Berry
Hey thanks, Karl, but did you say you tested that and it worked?

On Fri, Jul 16, 2010 at 2:59 PM, Karl DeSaulniers k...@designdrumm.comwrote:

 Hi JC,
 I think this should be

 var myPopoutObj = new myPopout(e.target,this.btnNum,

 Per his example. Not positive if it matters, but I have had experience
 with strong typing voiding out an array and when I took off the :Array it
 worked.
 Not sure why. Just a thought.


 Karl



 On Jul 16, 2010, at 4:49 PM, J.C. Berry wrote:

  Didn't I try that with
 var myPopoutObj:myPopout = new myPopout(e.target,this.btnNum,
 this.cityList);
 addChild(myPopoutObj);//Does not work either

 ? Help to be appreciated!



 On Fri, Jul 16, 2010 at 2:13 PM, Mattheis, Erik (MIN-WSW) 
 ematth...@webershandwick.com wrote:

  If you're creating myPopout from within the document class or any other
 class that has been added to the stage, you would say

 _myPopout = new myPopout();
 addChild(_myPopout);

 _ _ _
 Erik Mattheis
 Senior Web Developer
 Minneapolis
 T  952 346 6610
 C 612 377 2272

 Weber Shandwick
 Advocacy starts here.

 PRWeek Global Agency Report Card 2009 - Gold Medal Winner
 The Holmes Report Global Agency of the Year
 PR News Agency of the Year


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
 flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of J.C. Berry
 Sent: Friday, July 16, 2010 3:14 PM
 To: Flash Coders List
 Subject: Re: [Flashcoders] Help with addChild

 public function initPopout(stageBtn,btnNum,
 cityList){
   if(btnNum  25){
   trace(this);
   var popInstance:Tba = new Tba();
   popInstance.x = 10;
   popInstance.y = 10;
   popInstance.name = 'cityPopout'+btnNum+'_mc';
   popInstance.alpha = 1;
   addChild(popInstance);//no error or result

 Yes, the last line in my other class (addChild(popInstance);)  adds the
 Tba instance, but it only works if I use one of the buttons on stage. How
 do
 I add a class (myPopout) to the stage?


 On Fri, Jul 16, 2010 at 1:03 PM, Mattheis, Erik (MIN-WSW) 
 ematth...@webershandwick.com wrote:

  I'd guess your other class is not in the display list. Do you say
 addChild(OtherClass) anywhere?

 _ _ _
 Erik Mattheis
 Senior Web Developer
 Minneapolis
 T  952 346 6610
 C 612 377 2272

 Weber Shandwick
 Advocacy starts here.

 PRWeek Global Agency Report Card 2009 - Gold Medal Winner
 The Holmes Report Global Agency of the Year
 PR News Agency of the Year


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
 flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of J.C. Berry
 Sent: Friday, July 16, 2010 2:40 PM
 To: Flash Coders List
 Subject: Re: [Flashcoders] Help with addChild

  From separate class:

 var myPopout:myPopout = new
 myPopout(e.target,this.btnNum,this.cityList);
 //Calls below

  From other class:


 public function myPopout(stageBtn,btnNum,cityList){//constructor
   this.btnNum = btnNum;
   this.cityList = cityList;
   this.stageBtn = stageBtn;
   initPopout(stageBtn,btnNum,cityList);
   }

 public function initPopout(stageBtn,btnNum,cityList){
   if(btnNum  25){
   trace(this);
   var popInstance:Tba = new Tba();
   popInstance.x = 10;
   popInstance.y = 10;
   popInstance.name = 'cityPopout'+btnNum+'_mc';
   popInstance.alpha = 1;
   addChild(popInstance);//no error or result

 So here it only works if I use stageBtn.addChild(popInstance)





 On Fri, Jul 16, 2010 at 12:33 PM, Mattheis, Erik (MIN-WSW) 
 ematth...@webershandwick.com wrote:

  Yes, more code please.

 _ _ _
 Erik Mattheis
 Senior Web Developer
 Minneapolis
 T  952 346 6610
 C 612 377 2272

 Weber Shandwick
 Advocacy starts here.

 PRWeek Global Agency Report Card 2009 - Gold Medal Winner
 The Holmes Report Global Agency of the Year
 PR News Agency of the Year


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
 flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of J.C. Berry
 Sent: Friday, July 16, 2010 2:08 PM
 To: Flash Coders List
 Subject: Re: [Flashcoders] Help with addChild

 You are right. But do you know what it could be, Henrik? Do you need to

 see

 some more code?

 On Fri, Jul 16, 2010 at 1:34 AM, Henrik Andersson 

 he...@henke37.cjb.net

 wrote:


  Deepanjan Das wrote:

  Hi,
 I think the stage has not yet been initiated, hence the addChild is

 not

 working.
 Try to get hold of the stage first and then so an addChild.


 While that is indeed a common problem, it is not the current problem.

 He

 is

 adding to the main timeline, not the stage.

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




 --
 J.C. Berry, M.A.
 UI Developer
 619.306.1712(m)
 jcharlesbe...@gmail.com

Re: [Flashcoders] Help with addChild

2010-07-16 Thread Karl DeSaulniers

Hi JC,
I was speaking of my code I had a while ago and it was also in AS2,
but I had something like..

var newArray:Array = new Array();

and had to switch it to..

var newArray = new Array();

for it to work at all.
May have been something in my code somewhere else
that didn't like that strong typing of the array.
Not completely sure why that worked, was just glad it worked finally  
after staring at it for many hrs. :)

I did not test your code though, sry. Merely a suggestion to try.

Karl

On Jul 16, 2010, at 5:15 PM, J.C. Berry wrote:


Hey thanks, Karl, but did you say you tested that and it worked?

On Fri, Jul 16, 2010 at 2:59 PM, Karl DeSaulniers  
k...@designdrumm.comwrote:



Hi JC,
I think this should be

var myPopoutObj = new myPopout(e.target,this.btnNum,

Per his example. Not positive if it matters, but I have had  
experience
with strong typing voiding out an array and when I took off  
the :Array it

worked.
Not sure why. Just a thought.


Karl



On Jul 16, 2010, at 4:49 PM, J.C. Berry wrote:

 Didn't I try that with

var myPopoutObj:myPopout = new myPopout(e.target,this.btnNum,
this.cityList);
addChild(myPopoutObj);//Does not work either

? Help to be appreciated!



On Fri, Jul 16, 2010 at 2:13 PM, Mattheis, Erik (MIN-WSW) 
ematth...@webershandwick.com wrote:

 If you're creating myPopout from within the document class or  
any other

class that has been added to the stage, you would say

_myPopout = new myPopout();
addChild(_myPopout);

_ _ _
Erik Mattheis
Senior Web Developer
Minneapolis
T  952 346 6610
C 612 377 2272

Weber Shandwick
Advocacy starts here.

PRWeek Global Agency Report Card 2009 - Gold Medal Winner
The Holmes Report Global Agency of the Year
PR News Agency of the Year


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of J.C. Berry
Sent: Friday, July 16, 2010 3:14 PM
To: Flash Coders List
Subject: Re: [Flashcoders] Help with addChild

public function initPopout(stageBtn,btnNum,
cityList){
  if(btnNum  25){
  trace(this);
  var popInstance:Tba = new Tba();
  popInstance.x = 10;
  popInstance.y = 10;
  popInstance.name = 'cityPopout'+btnNum+'_mc';
  popInstance.alpha = 1;
  addChild(popInstance);//no error or result

Yes, the last line in my other class (addChild(popInstance);)   
adds the
Tba instance, but it only works if I use one of the buttons on  
stage. How

do
I add a class (myPopout) to the stage?


On Fri, Jul 16, 2010 at 1:03 PM, Mattheis, Erik (MIN-WSW) 
ematth...@webershandwick.com wrote:

 I'd guess your other class is not in the display list. Do you  
say

addChild(OtherClass) anywhere?

_ _ _
Erik Mattheis
Senior Web Developer
Minneapolis
T  952 346 6610
C 612 377 2272

Weber Shandwick
Advocacy starts here.

PRWeek Global Agency Report Card 2009 - Gold Medal Winner
The Holmes Report Global Agency of the Year
PR News Agency of the Year


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of J.C. Berry
Sent: Friday, July 16, 2010 2:40 PM
To: Flash Coders List
Subject: Re: [Flashcoders] Help with addChild

 From separate class:



var myPopout:myPopout = new
myPopout(e.target,this.btnNum,this.cityList);
//Calls below

 From other class:




public function myPopout(stageBtn,btnNum,cityList){//constructor
  this.btnNum = btnNum;
  this.cityList = cityList;
  this.stageBtn = stageBtn;
  initPopout(stageBtn,btnNum,cityList);
  }

public function initPopout(stageBtn,btnNum,cityList){
  if(btnNum  25){
  trace(this);
  var popInstance:Tba = new Tba();
  popInstance.x = 10;
  popInstance.y = 10;
  popInstance.name = 'cityPopout'+btnNum+'_mc';
  popInstance.alpha = 1;
  addChild(popInstance);//no error or result

So here it only works if I use stageBtn.addChild(popInstance)





On Fri, Jul 16, 2010 at 12:33 PM, Mattheis, Erik (MIN-WSW) 
ematth...@webershandwick.com wrote:

 Yes, more code please.


_ _ _
Erik Mattheis
Senior Web Developer
Minneapolis
T  952 346 6610
C 612 377 2272

Weber Shandwick
Advocacy starts here.

PRWeek Global Agency Report Card 2009 - Gold Medal Winner
The Holmes Report Global Agency of the Year
PR News Agency of the Year


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of J.C.  
Berry

Sent: Friday, July 16, 2010 2:08 PM
To: Flash Coders List
Subject: Re: [Flashcoders] Help with addChild

You are right. But do you know what it could be, Henrik? Do  
you need to



see


some more code?

On Fri, Jul 16, 2010 at 1:34 AM, Henrik Andersson 


he...@henke37.cjb.net



wrote:




 Deepanjan Das wrote:


 Hi,
I think the stage has not yet been initiated, hence

Re: [Flashcoders] Help with addChild

2010-07-16 Thread J.C. Berry
OK thanks!

On Fri, Jul 16, 2010 at 3:24 PM, Karl DeSaulniers k...@designdrumm.comwrote:

 Hi JC,
 I was speaking of my code I had a while ago and it was also in AS2,
 but I had something like..

 var newArray:Array = new Array();

 and had to switch it to..

 var newArray = new Array();

 for it to work at all.
 May have been something in my code somewhere else
 that didn't like that strong typing of the array.
 Not completely sure why that worked, was just glad it worked finally after
 staring at it for many hrs. :)
 I did not test your code though, sry. Merely a suggestion to try.

 Karl


 On Jul 16, 2010, at 5:15 PM, J.C. Berry wrote:

  Hey thanks, Karl, but did you say you tested that and it worked?

 On Fri, Jul 16, 2010 at 2:59 PM, Karl DeSaulniers k...@designdrumm.com
 wrote:

  Hi JC,
 I think this should be

 var myPopoutObj = new myPopout(e.target,this.btnNum,

 Per his example. Not positive if it matters, but I have had experience
 with strong typing voiding out an array and when I took off the :Array it
 worked.
 Not sure why. Just a thought.


 Karl



 On Jul 16, 2010, at 4:49 PM, J.C. Berry wrote:

  Didn't I try that with

 var myPopoutObj:myPopout = new myPopout(e.target,this.btnNum,
 this.cityList);
 addChild(myPopoutObj);//Does not work either

 ? Help to be appreciated!



 On Fri, Jul 16, 2010 at 2:13 PM, Mattheis, Erik (MIN-WSW) 
 ematth...@webershandwick.com wrote:

  If you're creating myPopout from within the document class or any other

 class that has been added to the stage, you would say

 _myPopout = new myPopout();
 addChild(_myPopout);

 _ _ _
 Erik Mattheis
 Senior Web Developer
 Minneapolis
 T  952 346 6610
 C 612 377 2272

 Weber Shandwick
 Advocacy starts here.

 PRWeek Global Agency Report Card 2009 - Gold Medal Winner
 The Holmes Report Global Agency of the Year
 PR News Agency of the Year


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
 flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of J.C. Berry
 Sent: Friday, July 16, 2010 3:14 PM
 To: Flash Coders List
 Subject: Re: [Flashcoders] Help with addChild

 public function initPopout(stageBtn,btnNum,
 cityList){
  if(btnNum  25){
  trace(this);
  var popInstance:Tba = new Tba();
  popInstance.x = 10;
  popInstance.y = 10;
  popInstance.name = 'cityPopout'+btnNum+'_mc';
  popInstance.alpha = 1;
  addChild(popInstance);//no error or result

 Yes, the last line in my other class (addChild(popInstance);)  adds
 the
 Tba instance, but it only works if I use one of the buttons on stage.
 How
 do
 I add a class (myPopout) to the stage?


 On Fri, Jul 16, 2010 at 1:03 PM, Mattheis, Erik (MIN-WSW) 
 ematth...@webershandwick.com wrote:

  I'd guess your other class is not in the display list. Do you say

 addChild(OtherClass) anywhere?

 _ _ _
 Erik Mattheis
 Senior Web Developer
 Minneapolis
 T  952 346 6610
 C 612 377 2272

 Weber Shandwick
 Advocacy starts here.

 PRWeek Global Agency Report Card 2009 - Gold Medal Winner
 The Holmes Report Global Agency of the Year
 PR News Agency of the Year


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
 flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of J.C. Berry
 Sent: Friday, July 16, 2010 2:40 PM
 To: Flash Coders List
 Subject: Re: [Flashcoders] Help with addChild

  From separate class:


  var myPopout:myPopout = new
 myPopout(e.target,this.btnNum,this.cityList);
 //Calls below

  From other class:



 public function myPopout(stageBtn,btnNum,cityList){//constructor
  this.btnNum = btnNum;
  this.cityList = cityList;
  this.stageBtn = stageBtn;
  initPopout(stageBtn,btnNum,cityList);
  }

 public function initPopout(stageBtn,btnNum,cityList){
  if(btnNum  25){
  trace(this);
  var popInstance:Tba = new Tba();
  popInstance.x = 10;
  popInstance.y = 10;
  popInstance.name = 'cityPopout'+btnNum+'_mc';
  popInstance.alpha = 1;
  addChild(popInstance);//no error or result

 So here it only works if I use stageBtn.addChild(popInstance)





 On Fri, Jul 16, 2010 at 12:33 PM, Mattheis, Erik (MIN-WSW) 
 ematth...@webershandwick.com wrote:

  Yes, more code please.


 _ _ _
 Erik Mattheis
 Senior Web Developer
 Minneapolis
 T  952 346 6610
 C 612 377 2272

 Weber Shandwick
 Advocacy starts here.

 PRWeek Global Agency Report Card 2009 - Gold Medal Winner
 The Holmes Report Global Agency of the Year
 PR News Agency of the Year


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
 flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of J.C. Berry
 Sent: Friday, July 16, 2010 2:08 PM
 To: Flash Coders List
 Subject: Re: [Flashcoders] Help with addChild

 You are right. But do you know what it could be, Henrik? Do you need
 to

  see

  some more code

[Flashcoders] Help with addChild

2010-07-15 Thread J.C. Berry
Dear Group,
I wondered if I could bother you a minute with a simple question. I have a
document class that extends MovieClip, but my problem arises when I  use
addChild to add some popups (movieclips) to the stage. They are only visible
when I attach my popups to an on-stage button:
mystagebtn.addChild(mypopup) but I get nothing when attaching using
addChild() or this.addChild or this.parent.addChild   What reasons can there
be for my clips not being visible?  As I said, my document class does extend
MovieClip and I have searched for a few days now and reading on the doc
class has not given me an answer. I wouldn't even mind a reference to a
tutorial that could help me. Thanks.
-JC

On Wed, Jul 7, 2010 at 6:55 AM, allandt bik-elliott (thefieldcomic.com) 
alla...@gmail.com wrote:

 does this line work?


 DynaBtn.addEventListener(MouseEvent.MOUSE_OVER,DynaBtnRollOverHandler(CityNum));

 i wouldn't have thought it would (by using the brackets you are calling
 that
 function straight away)

 it should be

DynaBtn.addEventListener(MouseEvent.MOUSE_OVER,DynaBtnRollOverHandler);
 }

 private function DynaBtnRollOverHandler(e:Event):void
 {
// handle event
 }

 and cityNum should be a property on DynaBtn so that you can use
 (e.target as DynaBtn).cityNum
 to recall the correct number

 best
 a

 On 7 July 2010 14:40, Kerry Thompson al...@cyberiantiger.biz wrote:

  J.C. Berry wrote:
 
   I wondered if I could bother you to review the code below and make
  comments
   and suggestions.
 
  It's not bad at all, especially for your first class. I didn't go
  through all your code, but one thing jumped out at me. These lines
  might give you problems:
 
  for(var i=0;iNumOfCities;i++){
   CityNum = i;
   var DynaBtn = root['city'+CityNum+'_mc'];
   DynaBtn.gotoAndStop(1);
 
 
  
 DynaBtn.addEventListener(MouseEvent.MOUSE_OVER,DynaBtnRollOverHandler(CityNum));
   DynaBtn.addEventListener(MouseEvent.MOUSE_OUT,DynaBtnRollOutHandler);
 
  First, you are going to have only one DynaBtn variable--the last one
  declared in the for loop. Each time you create an instance, it
  overwrites the last one. Fortunately for you, it works, but it won't
  always.
 
  The second issue is adding an event listener from outside the object.
  DynaBtn.addEventListener() will add the listener to the button, but
  you won't be able to remove the listener from outside the button.
 
  Instead, you should have a DynaBtn class, and add the listener in the
  constructor. Then you can remove the event listeners when you clean
  up.
 
  This applies, of course, to all the buttons you created.
 
  Nice job overall, though.
 
  Cordially,
 
  Kerry Thompson
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




-- 
J.C. Berry, M.A.
UI Developer
619.306.1712(m)
jcharlesbe...@gmail.com
portfolio: http://Client:maz...@www.mindarc.com


This E-mail is covered by the Electronic Communications Privacy Act, 18
U.S.C. ?? 2510-2521 and is legally privileged. This information is
confidential information and is intended only for the use of the individual
or entity named above. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Help with addChild

2010-07-15 Thread Deepanjan Das
Hi,
I think the stage has not yet been initiated, hence the addChild is not
working.
Try to get hold of the stage first and then so an addChild.

if(stage){

}else{
 addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);
}

private function onAddedToStage(e:Event):void
  {
   removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
addChild(...);
 }
Hope this helps.

Warm Regards
Deepanjan Das
M: +91 9836582808
W: http://deepanjandas.wordpress.com

Think of the environment before printing this email


On Fri, Jul 16, 2010 at 8:26 AM, J.C. Berry jcharlesbe...@gmail.com wrote:

 Dear Group,
 I wondered if I could bother you a minute with a simple question. I have a
 document class that extends MovieClip, but my problem arises when I  use
 addChild to add some popups (movieclips) to the stage. They are only
 visible
 when I attach my popups to an on-stage button:
 mystagebtn.addChild(mypopup) but I get nothing when attaching using
 addChild() or this.addChild or this.parent.addChild   What reasons can
 there
 be for my clips not being visible?  As I said, my document class does
 extend
 MovieClip and I have searched for a few days now and reading on the doc
 class has not given me an answer. I wouldn't even mind a reference to a
 tutorial that could help me. Thanks.
 -JC

 On Wed, Jul 7, 2010 at 6:55 AM, allandt bik-elliott (thefieldcomic.com) 
 alla...@gmail.com wrote:

  does this line work?
 
 
 
 DynaBtn.addEventListener(MouseEvent.MOUSE_OVER,DynaBtnRollOverHandler(CityNum));
 
  i wouldn't have thought it would (by using the brackets you are calling
  that
  function straight away)
 
  it should be
 
 
  DynaBtn.addEventListener(MouseEvent.MOUSE_OVER,DynaBtnRollOverHandler);
  }
 
  private function DynaBtnRollOverHandler(e:Event):void
  {
 // handle event
  }
 
  and cityNum should be a property on DynaBtn so that you can use
  (e.target as DynaBtn).cityNum
  to recall the correct number
 
  best
  a
 
  On 7 July 2010 14:40, Kerry Thompson al...@cyberiantiger.biz wrote:
 
   J.C. Berry wrote:
  
I wondered if I could bother you to review the code below and make
   comments
and suggestions.
  
   It's not bad at all, especially for your first class. I didn't go
   through all your code, but one thing jumped out at me. These lines
   might give you problems:
  
   for(var i=0;iNumOfCities;i++){
CityNum = i;
var DynaBtn = root['city'+CityNum+'_mc'];
DynaBtn.gotoAndStop(1);
  
  
 
  
 DynaBtn.addEventListener(MouseEvent.MOUSE_OVER,DynaBtnRollOverHandler(CityNum));
DynaBtn.addEventListener(MouseEvent.MOUSE_OUT,DynaBtnRollOutHandler);
  
   First, you are going to have only one DynaBtn variable--the last one
   declared in the for loop. Each time you create an instance, it
   overwrites the last one. Fortunately for you, it works, but it won't
   always.
  
   The second issue is adding an event listener from outside the object.
   DynaBtn.addEventListener() will add the listener to the button, but
   you won't be able to remove the listener from outside the button.
  
   Instead, you should have a DynaBtn class, and add the listener in the
   constructor. Then you can remove the event listeners when you clean
   up.
  
   This applies, of course, to all the buttons you created.
  
   Nice job overall, though.
  
   Cordially,
  
   Kerry Thompson
   ___
   Flashcoders mailing list
   Flashcoders@chattyfig.figleaf.com
   http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
  
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 



 --
 J.C. Berry, M.A.
 UI Developer
 619.306.1712(m)
 jcharlesbe...@gmail.com
 portfolio: http://Client:maz...@www.mindarc.com

 

 This E-mail is covered by the Electronic Communications Privacy Act, 18
 U.S.C. ?? 2510-2521 and is legally privileged. This information is
 confidential information and is intended only for the use of the individual
 or entity named above. If the reader of this message is not the intended
 recipient, you are hereby notified that any dissemination, distribution or
 copying of this communication is strictly prohibited.

 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




--
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Help with first class

2010-07-07 Thread J.C. Berry
Hello all,
I wondered if I could bother you to review the code below and make comments
and suggestions. It's my first full attempt (from scratch) to create a
class. I would appreciate any comments you would like to make. Thanks. Oh,
and to get an idea of how it looks, the project is located at
http://www.fjroadtrip.com
Thanks!


package{
import fl.controls.TextArea;
import fl.containers.ScrollPane;
import fl.controls.Button;
import flash.display.*;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.net.URLLoader;
import fl.managers.StyleManager;

public class DynaMap extends MovieClip{
XML.ignoreWhitespace = false;
private var myXML:XML;
private var myXMLLoaderReq:URLRequest;
private var myXMLLoader:URLLoader;
private var CityList:XMLList;
private var CityNum:Number = 0;
private var PhotoArray:Array;
private var CurrPhoto:Number = 0;
private var NumOfCities:Number;
private var myWin:ScrollPane = new ScrollPane();
private var DayPicURLReq:URLRequest;
private var myWinLoader:Loader = new Loader();
private var tbaInstance;
private var CityTextBox:TextArea = new TextArea();
private var myCloseBtn:Button = new Button();//closebtn
privatevar myNextBtn:Button = new Button();//nextbtn

public function DynaMap(){
myXMLLoaderReq = new URLRequest('cities.xml');
myXMLLoader = new URLLoader(myXMLLoaderReq);
myXMLLoader.addEventListener(Event.COMPLETE, xmlLoaded);
}
private function xmlLoaded(e:Event):void{
myXML = new XML(myXMLLoader.data);
CityList = new XMLList(myXML.city);
NumOfCities = CityList.length();
//initStage(cityList,0);
for(var i=0;iNumOfCities;i++){
CityNum = i;
var DynaBtn = root['city'+CityNum+'_mc'];
DynaBtn.gotoAndStop(1);

DynaBtn.addEventListener(MouseEvent.MOUSE_OVER,DynaBtnRollOverHandler(CityNum));

DynaBtn.addEventListener(MouseEvent.MOUSE_OUT,DynaBtnRollOutHandler);
}
}
private function ClearScreen(){
for (var k:int =0; k  numChildren; k++){

if(getChildAt(k).name.indexOf('Popout')-1)removeChildAt(k);
}
}
private function PopoutImgListener(e:Event):void{
e.target.content.x = -93;
e.target.content.y = -47;
e.target.content.alpha = 0;
tbaInstance.addChild(e.target.content);
}
private function DynaBtnRollOverHandler(cityNum){
return function(){
root['city'+cityNum+'_mc'].gotoAndStop(2);
ClearScreen();
var PopoutContentLoader:Loader = new Loader();
var PopoutContentListener:Object = {};
if(cityNum  25){
tbaInstance = new tba2();
tbaInstance.x = root['city'+cityNum+'_mc'].x-105;
tbaInstance.y = root['city'+cityNum+'_mc'].y-55;
tbaInstance.name = 'cityPopout'+cityNum+'_mc';
addChild(tbaInstance);
}else{
tbaInstance = new tba();
tbaInstance.x = root['city'+cityNum+'_mc'].x+99;
tbaInstance.y = root['city'+cityNum+'_mc'].y-55;
tbaInstance.name = 'cityPopout'+cityNum+'_mc';
addChild(tbaInstance);
}

PopoutContentLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,PopoutImgListener);
var pictURLReq:URLRequest = new URLRequest('images/' +
CityList[cityNum].images);
PopoutContentLoader.load(pictURLReq);
//XML.ignoreWhitespace = false;
PhotoArray = CityList[cityNum].gallery.split(',');
if(PhotoArray.length  0){

tbaInstance.addEventListener(Event.ENTER_FRAME,EnterFrameListener(cityNum));

tbaInstance.addEventListener(MouseEvent.MOUSE_UP,ClickPopoutListener);

//tbaInstance.addEventListener(MouseEvent.MOUSE_OUT,ClearScreen);
}
with(CityTextBox){
x = -11;
y = -53;
width = 98;
height = 105;
selectable = true;
alpha = 0;
wordWrap = true;
verticalScrollPolicy = 'off';
horizontalScrollPolicy = 'off';
}
tbaInstance.addChild(CityTextBox);
}
}
private function DynaBtnRollOutHandler(e:Event):void{
e.target.gotoAndStop(1);
}
private function EnterFrameListener(cityNum){
return function(){
if(tbaInstance.currentFrame == 8){
tbaInstance.getChildAt(1).alpha =
tbaInstance.getChildAt(2).alpha = 1;
   

Re: [Flashcoders] Help with first class

2010-07-07 Thread allandt bik-elliott (thefieldcomic.com)
after a quick glance i'd recommend a couple of things:

see if you can break your application into smaller chunks that interact with
each other rather than have a single class - one of the benefits of oop is
being able to visualise the problem as distinct tasks that are handled by
separate objects (classes)

second is just naming conventions - generally only classes should start with
a capital letter - instances (like CityList and PhotoArray) should be camel
case (cityList and photoArray). My own personal preference is to prefix with
the object type (listCities and arPhotos), much like hungarian notation but
there's discussion about how relevant that is in these days of proper coding
environments with automatic code completion (like FlashDevelop and FDT).

It's also considered good form for method names to be verbs (getVariable(),
handleEvent(), completeSetup()) although many people like to make their
event handlers follow the form onEnterFrame() / onMouseEvent() (i use
handleEventname() for mine)

You should try to give values to your class variables in the constructor /
init method or when they're needed if possible. An instance of
myCloseBtn:Button that is added when the variable is declared and then is
never used is memory / cpu wasted

i'll be looking through the code a bit closer when i get a chance - i'm sure
there's others here who will comment as well

best
a

On 7 July 2010 07:45, J.C. Berry jcharlesbe...@gmail.com wrote:

 Hello all,
 I wondered if I could bother you to review the code below and make comments
 and suggestions. It's my first full attempt (from scratch) to create a
 class. I would appreciate any comments you would like to make. Thanks. Oh,
 and to get an idea of how it looks, the project is located at
 http://www.fjroadtrip.com
 Thanks!


 package{
import fl.controls.TextArea;
import fl.containers.ScrollPane;
import fl.controls.Button;
import flash.display.*;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.net.URLLoader;
import fl.managers.StyleManager;

public class DynaMap extends MovieClip{
XML.ignoreWhitespace = false;
private var myXML:XML;
private var myXMLLoaderReq:URLRequest;
private var myXMLLoader:URLLoader;
private var CityList:XMLList;
private var CityNum:Number = 0;
private var PhotoArray:Array;
private var CurrPhoto:Number = 0;
private var NumOfCities:Number;
private var myWin:ScrollPane = new ScrollPane();
private var DayPicURLReq:URLRequest;
private var myWinLoader:Loader = new Loader();
private var tbaInstance;
private var CityTextBox:TextArea = new TextArea();
private var myCloseBtn:Button = new Button();//closebtn
privatevar myNextBtn:Button = new Button();//nextbtn

public function DynaMap(){
myXMLLoaderReq = new URLRequest('cities.xml');
myXMLLoader = new URLLoader(myXMLLoaderReq);
myXMLLoader.addEventListener(Event.COMPLETE, xmlLoaded);
}
private function xmlLoaded(e:Event):void{
myXML = new XML(myXMLLoader.data);
CityList = new XMLList(myXML.city);
NumOfCities = CityList.length();
//initStage(cityList,0);
for(var i=0;iNumOfCities;i++){
CityNum = i;
var DynaBtn = root['city'+CityNum+'_mc'];
DynaBtn.gotoAndStop(1);


 DynaBtn.addEventListener(MouseEvent.MOUSE_OVER,DynaBtnRollOverHandler(CityNum));

 DynaBtn.addEventListener(MouseEvent.MOUSE_OUT,DynaBtnRollOutHandler);
}
}
private function ClearScreen(){
for (var k:int =0; k  numChildren; k++){

 if(getChildAt(k).name.indexOf('Popout')-1)removeChildAt(k);
}
}
private function PopoutImgListener(e:Event):void{
e.target.content.x = -93;
e.target.content.y = -47;
e.target.content.alpha = 0;
tbaInstance.addChild(e.target.content);
}
private function DynaBtnRollOverHandler(cityNum){
return function(){
root['city'+cityNum+'_mc'].gotoAndStop(2);
ClearScreen();
var PopoutContentLoader:Loader = new Loader();
var PopoutContentListener:Object = {};
if(cityNum  25){
tbaInstance = new tba2();
tbaInstance.x = root['city'+cityNum+'_mc'].x-105;
tbaInstance.y = root['city'+cityNum+'_mc'].y-55;
tbaInstance.name = 'cityPopout'+cityNum+'_mc';
addChild(tbaInstance);
}else{
tbaInstance = new tba();
tbaInstance.x = root['city'+cityNum+'_mc'].x+99;
tbaInstance.y = root['city'+cityNum+'_mc'].y-55;
tbaInstance.name = 

Re: [Flashcoders] Help with first class

2010-07-07 Thread Kerry Thompson
J.C. Berry wrote:

 I wondered if I could bother you to review the code below and make comments
 and suggestions.

It's not bad at all, especially for your first class. I didn't go
through all your code, but one thing jumped out at me. These lines
might give you problems:

for(var i=0;iNumOfCities;i++){
  CityNum = i;
  var DynaBtn = root['city'+CityNum+'_mc'];
  DynaBtn.gotoAndStop(1);
  
DynaBtn.addEventListener(MouseEvent.MOUSE_OVER,DynaBtnRollOverHandler(CityNum));
  DynaBtn.addEventListener(MouseEvent.MOUSE_OUT,DynaBtnRollOutHandler);

First, you are going to have only one DynaBtn variable--the last one
declared in the for loop. Each time you create an instance, it
overwrites the last one. Fortunately for you, it works, but it won't
always.

The second issue is adding an event listener from outside the object.
DynaBtn.addEventListener() will add the listener to the button, but
you won't be able to remove the listener from outside the button.

Instead, you should have a DynaBtn class, and add the listener in the
constructor. Then you can remove the event listeners when you clean
up.

This applies, of course, to all the buttons you created.

Nice job overall, though.

Cordially,

Kerry Thompson
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Help with first class

2010-07-07 Thread allandt bik-elliott (thefieldcomic.com)
another note on naming convention

it's fairly normal to mark private class variables out in some way (usually
an underscore before the name (private var _myVar:String;) and leave public
variables / getters/setters without - this will give you more options for
your variable names (within methods, for instance) and will help you work
out whether a variable is available outside the class at a glance

a



On 7 July 2010 14:26, allandt bik-elliott (thefieldcomic.com) 
alla...@gmail.com wrote:

 after a quick glance i'd recommend a couple of things:

 see if you can break your application into smaller chunks that interact
 with each other rather than have a single class - one of the benefits of oop
 is being able to visualise the problem as distinct tasks that are handled by
 separate objects (classes)

 second is just naming conventions - generally only classes should start
 with a capital letter - instances (like CityList and PhotoArray) should be
 camel case (cityList and photoArray). My own personal preference is to
 prefix with the object type (listCities and arPhotos), much like hungarian
 notation but there's discussion about how relevant that is in these days of
 proper coding environments with automatic code completion (like FlashDevelop
 and FDT).

 It's also considered good form for method names to be verbs (getVariable(),
 handleEvent(), completeSetup()) although many people like to make their
 event handlers follow the form onEnterFrame() / onMouseEvent() (i use
 handleEventname() for mine)

 You should try to give values to your class variables in the constructor /
 init method or when they're needed if possible. An instance of
 myCloseBtn:Button that is added when the variable is declared and then is
 never used is memory / cpu wasted

 i'll be looking through the code a bit closer when i get a chance - i'm
 sure there's others here who will comment as well

 best
 a


 On 7 July 2010 07:45, J.C. Berry jcharlesbe...@gmail.com wrote:

 Hello all,
 I wondered if I could bother you to review the code below and make
 comments
 and suggestions. It's my first full attempt (from scratch) to create a
 class. I would appreciate any comments you would like to make. Thanks. Oh,
 and to get an idea of how it looks, the project is located at
 http://www.fjroadtrip.com
 Thanks!


 package{
import fl.controls.TextArea;
import fl.containers.ScrollPane;
import fl.controls.Button;
import flash.display.*;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.net.URLLoader;
import fl.managers.StyleManager;

public class DynaMap extends MovieClip{
XML.ignoreWhitespace = false;
private var myXML:XML;
private var myXMLLoaderReq:URLRequest;
private var myXMLLoader:URLLoader;
private var CityList:XMLList;
private var CityNum:Number = 0;
private var PhotoArray:Array;
private var CurrPhoto:Number = 0;
private var NumOfCities:Number;
private var myWin:ScrollPane = new ScrollPane();
private var DayPicURLReq:URLRequest;
private var myWinLoader:Loader = new Loader();
private var tbaInstance;
private var CityTextBox:TextArea = new TextArea();
private var myCloseBtn:Button = new Button();//closebtn
privatevar myNextBtn:Button = new Button();//nextbtn

public function DynaMap(){
myXMLLoaderReq = new URLRequest('cities.xml');
myXMLLoader = new URLLoader(myXMLLoaderReq);
myXMLLoader.addEventListener(Event.COMPLETE, xmlLoaded);
}
private function xmlLoaded(e:Event):void{
myXML = new XML(myXMLLoader.data);
CityList = new XMLList(myXML.city);
NumOfCities = CityList.length();
//initStage(cityList,0);
for(var i=0;iNumOfCities;i++){
CityNum = i;
var DynaBtn = root['city'+CityNum+'_mc'];
DynaBtn.gotoAndStop(1);


 DynaBtn.addEventListener(MouseEvent.MOUSE_OVER,DynaBtnRollOverHandler(CityNum));

 DynaBtn.addEventListener(MouseEvent.MOUSE_OUT,DynaBtnRollOutHandler);
}
}
private function ClearScreen(){
for (var k:int =0; k  numChildren; k++){

 if(getChildAt(k).name.indexOf('Popout')-1)removeChildAt(k);
}
}
private function PopoutImgListener(e:Event):void{
e.target.content.x = -93;
e.target.content.y = -47;
e.target.content.alpha = 0;
tbaInstance.addChild(e.target.content);
}
private function DynaBtnRollOverHandler(cityNum){
return function(){
root['city'+cityNum+'_mc'].gotoAndStop(2);
ClearScreen();
var PopoutContentLoader:Loader = new Loader();
var PopoutContentListener:Object = {};
if(cityNum  25){
tbaInstance = new 

Re: [Flashcoders] Help with first class

2010-07-07 Thread allandt bik-elliott (thefieldcomic.com)
does this line work?

DynaBtn.addEventListener(MouseEvent.MOUSE_OVER,DynaBtnRollOverHandler(CityNum));

i wouldn't have thought it would (by using the brackets you are calling that
function straight away)

it should be

DynaBtn.addEventListener(MouseEvent.MOUSE_OVER,DynaBtnRollOverHandler);
}

private function DynaBtnRollOverHandler(e:Event):void
{
// handle event
}

and cityNum should be a property on DynaBtn so that you can use
(e.target as DynaBtn).cityNum
to recall the correct number

best
a

On 7 July 2010 14:40, Kerry Thompson al...@cyberiantiger.biz wrote:

 J.C. Berry wrote:

  I wondered if I could bother you to review the code below and make
 comments
  and suggestions.

 It's not bad at all, especially for your first class. I didn't go
 through all your code, but one thing jumped out at me. These lines
 might give you problems:

 for(var i=0;iNumOfCities;i++){
  CityNum = i;
  var DynaBtn = root['city'+CityNum+'_mc'];
  DynaBtn.gotoAndStop(1);

  
 DynaBtn.addEventListener(MouseEvent.MOUSE_OVER,DynaBtnRollOverHandler(CityNum));
  DynaBtn.addEventListener(MouseEvent.MOUSE_OUT,DynaBtnRollOutHandler);

 First, you are going to have only one DynaBtn variable--the last one
 declared in the for loop. Each time you create an instance, it
 overwrites the last one. Fortunately for you, it works, but it won't
 always.

 The second issue is adding an event listener from outside the object.
 DynaBtn.addEventListener() will add the listener to the button, but
 you won't be able to remove the listener from outside the button.

 Instead, you should have a DynaBtn class, and add the listener in the
 constructor. Then you can remove the event listeners when you clean
 up.

 This applies, of course, to all the buttons you created.

 Nice job overall, though.

 Cordially,

 Kerry Thompson
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Help with first class

2010-07-07 Thread J.C. Berry
Thanks, Kerry and allandt. I will take your recommendations, allandt. Kerry,
when you said that I would end up with only the last DynaBtn, that is true.
But I wanted to ask about the solution I found using that DynaBtn handler
with the parameter. It returns the function and so it works. My question is,
is the better solution to create a separate class? More interesting for me
is, can it work without creating a separate class? Any elucidation would be
appreciated. Thanks again!

On Wed, Jul 7, 2010 at 6:55 AM, allandt bik-elliott (thefieldcomic.com) 
alla...@gmail.com wrote:

 does this line work?


 DynaBtn.addEventListener(MouseEvent.MOUSE_OVER,DynaBtnRollOverHandler(CityNum));

 i wouldn't have thought it would (by using the brackets you are calling
 that
 function straight away)

 it should be

DynaBtn.addEventListener(MouseEvent.MOUSE_OVER,DynaBtnRollOverHandler);
 }

 private function DynaBtnRollOverHandler(e:Event):void
 {
// handle event
 }

 and cityNum should be a property on DynaBtn so that you can use
 (e.target as DynaBtn).cityNum
 to recall the correct number

 best
 a

 On 7 July 2010 14:40, Kerry Thompson al...@cyberiantiger.biz wrote:

  J.C. Berry wrote:
 
   I wondered if I could bother you to review the code below and make
  comments
   and suggestions.
 
  It's not bad at all, especially for your first class. I didn't go
  through all your code, but one thing jumped out at me. These lines
  might give you problems:
 
  for(var i=0;iNumOfCities;i++){
   CityNum = i;
   var DynaBtn = root['city'+CityNum+'_mc'];
   DynaBtn.gotoAndStop(1);
 
 
  
 DynaBtn.addEventListener(MouseEvent.MOUSE_OVER,DynaBtnRollOverHandler(CityNum));
   DynaBtn.addEventListener(MouseEvent.MOUSE_OUT,DynaBtnRollOutHandler);
 
  First, you are going to have only one DynaBtn variable--the last one
  declared in the for loop. Each time you create an instance, it
  overwrites the last one. Fortunately for you, it works, but it won't
  always.
 
  The second issue is adding an event listener from outside the object.
  DynaBtn.addEventListener() will add the listener to the button, but
  you won't be able to remove the listener from outside the button.
 
  Instead, you should have a DynaBtn class, and add the listener in the
  constructor. Then you can remove the event listeners when you clean
  up.
 
  This applies, of course, to all the buttons you created.
 
  Nice job overall, though.
 
  Cordially,
 
  Kerry Thompson
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Help with first class

2010-07-07 Thread Kerry Thompson
J.C. Berry wrote:

 Thanks, Kerry and allandt. I will take your recommendations, allandt. Kerry,
 when you said that I would end up with only the last DynaBtn, that is true.
 But I wanted to ask about the solution I found using that DynaBtn handler
 with the parameter. It returns the function and so it works. My question is,
 is the better solution to create a separate class? More interesting for me
 is, can it work without creating a separate class? Any elucidation would be
 appreciated.

In your case, you never refer to the DynaBtn except to add the
listeners, so your code works.

There are two issues, though. If there are no references to an object,
that object is available for garbage collection. I think the fact that
you have the listeners attached gives each instance an implicit
reference--not entirely sure how it works under the hood, but that's
the only way I can explain why your buttons remain active without a
reference.

The other is a trap that you haven't run into, but will. When you add
the event listener, the event listener now belongs to the object. When
you want to remove that listener, you won't be able to do so from your
class (with a call like DynaBtn.removeEventListener(...).

You're setting yourself up for a couple of problems. One is a memory
leak--you can never get rid of the DynaBtn objects, and their
listeners will keep listening forever. That ties up resources.

Also, your listeners are fairly benign--they're just listening for
mouse events. But what if you had a listener that listened for a timer
event? It would periodically execute--perhaps several times a
second--and you would have no way of stopping it except killing the
timer.

The answer is pretty clear. Export the movie clips as a DynaBtnClass,
and create a DynaBtnClass class which adds and removes handlers from
itself. When you instantiate the buttons, put the references into an
array--DynaBtn would become an array in your DynaMap class.

Another thing I noticed--you have some variables that you haven't
declared the type for. For example, tbaInstance and DynaBtn. I would
strongly recommend that you put your compiler into strict mode and
declare a type for all variables.

It's a little extra work up front, and you'll have some choice words
when the compiler complains about untyped variables. But, believe me,
you would much rather the compiler catch your errors. The other option
is to spend hours trying to track down a mystery bug, and finally
finding that you set your variable to 42 (a string) instead of 42 (a
Number).

Cordially,

Kerry Thompson
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Help with first class

2010-07-07 Thread J.C. Berry
Thanks so much Kerry for taking the time. I really appreciate it.

On Wed, Jul 7, 2010 at 1:04 PM, Kerry Thompson al...@cyberiantiger.bizwrote:

 J.C. Berry wrote:

  Thanks, Kerry and allandt. I will take your recommendations, allandt.
 Kerry,
  when you said that I would end up with only the last DynaBtn, that is
 true.
  But I wanted to ask about the solution I found using that DynaBtn handler
  with the parameter. It returns the function and so it works. My question
 is,
  is the better solution to create a separate class? More interesting for
 me
  is, can it work without creating a separate class? Any elucidation would
 be
  appreciated.

 In your case, you never refer to the DynaBtn except to add the
 listeners, so your code works.

 There are two issues, though. If there are no references to an object,
 that object is available for garbage collection. I think the fact that
 you have the listeners attached gives each instance an implicit
 reference--not entirely sure how it works under the hood, but that's
 the only way I can explain why your buttons remain active without a
 reference.

 The other is a trap that you haven't run into, but will. When you add
 the event listener, the event listener now belongs to the object. When
 you want to remove that listener, you won't be able to do so from your
 class (with a call like DynaBtn.removeEventListener(...).

 You're setting yourself up for a couple of problems. One is a memory
 leak--you can never get rid of the DynaBtn objects, and their
 listeners will keep listening forever. That ties up resources.

 Also, your listeners are fairly benign--they're just listening for
 mouse events. But what if you had a listener that listened for a timer
 event? It would periodically execute--perhaps several times a
 second--and you would have no way of stopping it except killing the
 timer.

 The answer is pretty clear. Export the movie clips as a DynaBtnClass,
 and create a DynaBtnClass class which adds and removes handlers from
 itself. When you instantiate the buttons, put the references into an
 array--DynaBtn would become an array in your DynaMap class.

 Another thing I noticed--you have some variables that you haven't
 declared the type for. For example, tbaInstance and DynaBtn. I would
 strongly recommend that you put your compiler into strict mode and
 declare a type for all variables.

 It's a little extra work up front, and you'll have some choice words
 when the compiler complains about untyped variables. But, believe me,
 you would much rather the compiler catch your errors. The other option
 is to spend hours trying to track down a mystery bug, and finally
 finding that you set your variable to 42 (a string) instead of 42 (a
 Number).

 Cordially,

 Kerry Thompson
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




-- 
J.C. Berry, M.A.
UI Developer
619.306.1712(m)
jcharlesbe...@gmail.com
portfolio: http://Client:maz...@www.mindarc.com


This E-mail is covered by the Electronic Communications Privacy Act, 18
U.S.C. ?? 2510-2521 and is legally privileged. This information is
confidential information and is intended only for the use of the individual
or entity named above. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] help with CameraDetection class

2010-05-12 Thread Glen Pike

Hi,

Flash, Windows (Actual = Reported by Flash):

Logitech Quickcam Pro E3500 = USB Video Device
Logitech Quickcam C200 = USB Video Device
Logitech Webcam C905 = Quickcam Pro for Notebooks.

Flash, Linux, Gentoo using Kernel 2.6.29 with kernel module uvcvideo:

Logitech Quickcam Pro E3500 = UVC Camera (046d:0805) (V4L2)
Logitech Quickcam C200 = UVC Camera (046d:0802) (V4L2)
Logitech Webcam C905 = UVC Camera (046d:0991) (V4L2)

As you can see from the 2nd list, the names are not very helpful to 
a layperson user - if Linux is going to become mainstream, this really 
needs to be a bit more user-friendly...


This page is really useful help for Logitech's Linux camera stuff  
http://www.quickcamteam.net/


HTH

Glen

On 12/05/2010 04:07, Ktu wrote:

Hey List,

I wanted to throw together a list of Camera.name together.

If you have a webcam that you use on your computer (or built in) could you
please reply with the names of all the cameras that are connected.

1. Open a .swf (internet, local whatever)
2. Right click anywhere
3. choose settings from the context menu
4. go to camera tab (last one)
5. send me all the names that show up in your drop down


Specifically I would love if a macbook user could help. macbooks tend to
have three always there, and the last one is normally the webcam. I'm
updating the macbook detection in my class.

I'm not sure what I'm going to do with the list of webcams, but I'll compile
it and put it on my blog just in case.
Thanks list,
Ktu

blog.cataclysmicrewind.com/webcamdetection/
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


   


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] help with CameraDetection class

2010-05-12 Thread Ktu
thanks glen,

If anyone else is feeling up to it, the more info I get the better. Thanks
in advance.
more mac users?

Ktu

On Wed, May 12, 2010 at 4:50 AM, Glen Pike g...@engineeredarts.co.ukwrote:

 Hi,

Flash, Windows (Actual = Reported by Flash):

Logitech Quickcam Pro E3500 = USB Video Device
Logitech Quickcam C200 = USB Video Device
Logitech Webcam C905 = Quickcam Pro for Notebooks.

Flash, Linux, Gentoo using Kernel 2.6.29 with kernel module uvcvideo:

Logitech Quickcam Pro E3500 = UVC Camera (046d:0805) (V4L2)
Logitech Quickcam C200 = UVC Camera (046d:0802) (V4L2)
Logitech Webcam C905 = UVC Camera (046d:0991) (V4L2)

As you can see from the 2nd list, the names are not very helpful to a
 layperson user - if Linux is going to become mainstream, this really needs
 to be a bit more user-friendly...

This page is really useful help for Logitech's Linux camera stuff
 http://www.quickcamteam.net/

HTH

Glen


 On 12/05/2010 04:07, Ktu wrote:

 Hey List,

 I wanted to throw together a list of Camera.name together.

 If you have a webcam that you use on your computer (or built in) could you
 please reply with the names of all the cameras that are connected.

 1. Open a .swf (internet, local whatever)
 2. Right click anywhere
 3. choose settings from the context menu
 4. go to camera tab (last one)
 5. send me all the names that show up in your drop down


 Specifically I would love if a macbook user could help. macbooks tend to
 have three always there, and the last one is normally the webcam. I'm
 updating the macbook detection in my class.

 I'm not sure what I'm going to do with the list of webcams, but I'll
 compile
 it and put it on my blog just in case.
 Thanks list,
 Ktu

 blog.cataclysmicrewind.com/webcamdetection/
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders





 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] help with CameraDetection class

2010-05-11 Thread Ktu
Hey List,

I wanted to throw together a list of Camera.name together.

If you have a webcam that you use on your computer (or built in) could you
please reply with the names of all the cameras that are connected.

1. Open a .swf (internet, local whatever)
2. Right click anywhere
3. choose settings from the context menu
4. go to camera tab (last one)
5. send me all the names that show up in your drop down


Specifically I would love if a macbook user could help. macbooks tend to
have three always there, and the last one is normally the webcam. I'm
updating the macbook detection in my class.

I'm not sure what I'm going to do with the list of webcams, but I'll compile
it and put it on my blog just in case.
Thanks list,
Ktu

blog.cataclysmicrewind.com/webcamdetection/
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] help. mouseEvent doesn´t work o n SWF loaded with JavaScript.

2009-09-15 Thread Isaac Alves
solved !!
 xml problem...
thanks .
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] help with frame navigation and xml

2009-08-29 Thread John R. Sweeney Jr
As far as you know it was use two. But it might have been only YOU and no
one else ;)

Makes you wonder. Huh?:)

I know what you mean about plain text formatting. Its happened to me in the
past, when I've used my signature with a logo in it. Doesn't work very well.


Have a great day,
John


on 8/28/09 1:25 PM, Merrill, Jason at jason.merr...@bankofamerica.com wrote:

 But what's weird is it did show up for me on the list - just not you
 two
 
 
 Jason Merrill


John R. Sweeney Jr.
Interactive Multimedia Developer


OnDemand Interactive Inc
945 Washington Blvd.
Hoffman Estates, IL 60169
Office/Fax: 847.310.5959
Cellular: 847.651.4469
www.ondemandinteractive.com


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


FW: [Flashcoders] help with frame navigation and xml

2009-08-28 Thread Merrill, Jason
 Howdy Jason,
Didn't see a reply from you come through. Just you query (tit)... ;),
then
the email that said you answered it before. Nothing in between them.

That happens to me on this list sometimes, but only this list.  Seems
this list only accepts pure text formatted e-mails and if you forget
that and send in another format, it rejects your messages silently.
Sorry about that.

Isaac, here was my reply to your question yesterday from the thread,
help with frame navigation and xml:

You don't need any code inside the clip, I think you're approaching this
the wrong way around.  Why have the XML node based on the frame's label?
You already know it's going to intro since you have to tell the
MovieClip to go there. Do something like this instead:

var destination:String = intro;
myClip.gotoAndPlay(destination);
myClip.myTextField.text = myXML.myNode.(@destination);

Or could be this if your text is in the text node:

var destination:String = intro;
myClip.gotoAndPlay(destination);
myClip.myTextField.text = myXML.myNode.(@destination).text();

Hope that helps,


Jason Merrill 

Bank of  America   Global Learning 
Learning  Performance Soluions

Monthly meetings on making the most of the Adobe Flash Platform -
presented by bank associates, Adobe engineers, and outside experts in
the borader multimedia community - join the Bank of America Flash
Platform Community  (note: this is for Bank of America employees only)


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] help with frame navigation and xml

2009-08-28 Thread Merrill, Jason
But what's weird is it did show up for me on the list - just not you
two


Jason Merrill 

Bank of  America   Global Learning 
Learning  Performance Soluions

Monthly meetings on making the most of the Adobe Flash Platform -
presented by bank associates, Adobe engineers, and outside experts in
the borader multimedia community - join the Bank of America Flash
Platform Community  (note: this is for Bank of America employees only)


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] help with frame navigation and xml

2009-08-26 Thread Isaac Alves
Hi,

I'd like to have a function that tells a MovieClip to go to a specific
frame and then in this frame, look for a scpecific tag in an XML file,
based on the frame's label, and then take some text (a  bunch of
actually) that is in the XML node and put it on a TextField.

For example, clicking on a Next Frame button it will go to the next
frame (which has a label intro) of the movieclip and then search
content.xml for the tag that contains the attribute name equal to
intro and then put the content of the @text node into an empty
TextField that is already positioned in this intro frame.

Am I obligated to have the code in this specfic frame?

I'm doing it because if I have too much text within textfields in an
FLA file it becomes incredibly lagged and therefore impossible to
work.

I've tried to use the event ENTER.FRAME to do that but it rendered the
SWF lagged and consomming way too much memory...

Help !! Thanks in advance!!
Isaac
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] help with frame navigation and xml

2009-08-26 Thread Merrill, Jason
You don't need any code inside the clip, I think you're approaching this
the wrong way around.  Why have the XML node based on the frame's label?
You already know it's going to intro since you have to tell the
MovieClip to go there. Do something like this instead:

var destination:String = intro;
myClip.gotoAndPlay(destination);
myClip.myTextField.text = myXML.myNode.(@destination);

Hope that helps,

Jason Merrill 

Bank of  America   Global Learning 
Shared Services Solutions Development 

Monthly meetings on making the most of the Adobe Flash Platform -
presented by bank associates, Adobe engineers, and outside experts in
the borader multimedia community - join the Bank of America Flash
Platform Community  (note: this is for Bank of America employees only)




-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Isaac
Alves
Sent: Wednesday, August 26, 2009 8:17 AM
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] help with frame navigation and xml

Hi,

I'd like to have a function that tells a MovieClip to go to a specific
frame and then in this frame, look for a scpecific tag in an XML file,
based on the frame's label, and then take some text (a  bunch of
actually) that is in the XML node and put it on a TextField.

For example, clicking on a Next Frame button it will go to the next
frame (which has a label intro) of the movieclip and then search
content.xml for the tag that contains the attribute name equal to
intro and then put the content of the @text node into an empty
TextField that is already positioned in this intro frame.

Am I obligated to have the code in this specfic frame?

I'm doing it because if I have too much text within textfields in an
FLA file it becomes incredibly lagged and therefore impossible to
work.

I've tried to use the event ENTER.FRAME to do that but it rendered the
SWF lagged and consomming way too much memory...

Help !! Thanks in advance!!
Isaac
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] help with frame navigation and xml

2009-08-26 Thread Merrill, Jason
Or could be this if your text is in the text node:

var destination:String = intro;
myClip.gotoAndPlay(destination);
myClip.myTextField.text = myXML.myNode.(@destination).text();


Jason Merrill 

Bank of  America   Global Learning 
Shared Services Solutions Development 

Monthly meetings on making the most of the Adobe Flash Platform -
presented by bank associates, Adobe engineers, and outside experts in
the borader multimedia community - join the Bank of America Flash
Platform Community  (note: this is for Bank of America employees only)





-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill,
Jason
Sent: Wednesday, August 26, 2009 8:26 AM
To: Flash Coders List
Subject: RE: [Flashcoders] help with frame navigation and xml

You don't need any code inside the clip, I think you're approaching this
the wrong way around.  Why have the XML node based on the frame's label?
You already know it's going to intro since you have to tell the
MovieClip to go there. Do something like this instead:

var destination:String = intro;
myClip.gotoAndPlay(destination);
myClip.myTextField.text = myXML.myNode.(@destination);

Hope that helps,

Jason Merrill 

Bank of  America   Global Learning 
Shared Services Solutions Development 

Monthly meetings on making the most of the Adobe Flash Platform -
presented by bank associates, Adobe engineers, and outside experts in
the borader multimedia community - join the Bank of America Flash
Platform Community  (note: this is for Bank of America employees only)




-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Isaac
Alves
Sent: Wednesday, August 26, 2009 8:17 AM
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] help with frame navigation and xml

Hi,

I'd like to have a function that tells a MovieClip to go to a specific
frame and then in this frame, look for a scpecific tag in an XML file,
based on the frame's label, and then take some text (a  bunch of
actually) that is in the XML node and put it on a TextField.

For example, clicking on a Next Frame button it will go to the next
frame (which has a label intro) of the movieclip and then search
content.xml for the tag that contains the attribute name equal to
intro and then put the content of the @text node into an empty
TextField that is already positioned in this intro frame.

Am I obligated to have the code in this specfic frame?

I'm doing it because if I have too much text within textfields in an
FLA file it becomes incredibly lagged and therefore impossible to
work.

I've tried to use the event ENTER.FRAME to do that but it rendered the
SWF lagged and consomming way too much memory...

Help !! Thanks in advance!!
Isaac
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] help removing an display object created

2009-06-04 Thread Glen Pike

Hi,

   Sorry, I just replied to your other thread, but now I see your code...

   Try something like this...

   function removeClip(thenameoftheobject) {
  thenameoftheobject.parent.removeChild(thenameoftheobject);
   }

   Glen

Gustavo Duenas wrote:



I have several buttons which create some windows based on a movie clip 
that exports for actioncript.
Everything is ok, with the creation, but when it comes to close them ( 
I have a button in the window itself that

can remove the child), I will trying to do it using actionscript.

if (stage.contains(thenameoftheobject)){
stage.removeChild(thenameoftheobject)}

but so far it isn't working,
Flash is telling me that the display object is not there (course is 
not there until it is created by the button) so everyone knows how 
could I
remove the child from the same buttons without the warning that the 
buttons are not there.


here is my code for the windows. it will explain how I have those 
created.


function newClick(e:MouseEvent){
productsOff();
removerChild()

gotoAndPlay(75);
var newBack:Loader = new Loader();
newBack.load(new URLRequest(imgs/sombrero.jpg));
this.backMovie.addChild(newBack)

var myWindow:AboutUsWindow = new AboutUsWindow();

myWindow.name = e.currentTarget.name;
trace(myWindow.name);
myWindow.x=500.0;
myWindow.y=391.0;
var myText:URLLoader= new URLLoader();
myText.addEventListener(Event.COMPLETE, onLoaded);
function onLoaded(e:Event):void{
myWindow.textoWindow.text= e.target.data;
myScroll.scrollTarget=myWindow.textoWindow;
   
}

myText.load(new URLRequest(text/+ e.currentTarget.name+.txt));
var myScroll:UIScrollBar = new UIScrollBar();
myScroll.enabled=true;
myScroll.direction= VERTICAL;
myScroll.setSize(myWindow.textoWindow.width, 
myWindow.textoWindow.height);


myScroll.x=300;
myScroll.y=-33;
myScroll.height = myWindow.textoWindow.height;
myWindow.addChild(myScroll);
var myLoader:Loader = new Loader();
myLoader.load(new URLRequest(e.currentTarget.name+.swf));
myWindow.imgScreen.addChild(myLoader);
myWindow.botoncito.buttonMode=true;
myWindow.botoncito.addEventListener(MouseEvent.MOUSE_OVER, 
botoncitoOver);
myWindow.botoncito.addEventListener(MouseEvent.MOUSE_OUT, 
botoncitoOut);
myWindow.botoncito.addEventListener(MouseEvent.CLICK, 
botoncitoClick);


//new botoncitoBehaviour//


function botoncitoOver(e:MouseEvent):void{

e.currentTarget.gotoAndPlay(2);
   
}

function botoncitoOut(e:MouseEvent):void{
e.currentTarget.gotoAndStop(1);
}
function botoncitoClick(e:MouseEvent):void{
   
removeChild(e.currentTarget.parent);
   
}

addChild(myWindow);

}



Any help is appreciated.

Gus


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] help removing an display object created

2009-06-04 Thread Gustavo Duenas
Hi Glen, problem is that for each button it creates a different clip  
named newWindow.


I have them named and it works according to your last formula the  
name of each one is root1 + the name on the object
I 'm trying to make a code to see first which is the object that is  
already created like


function removeClip():void{

if (root1.displayObject.name ==contact){
removeChild(root1.contact);
}else if(root1.displayObject.name==aboutUs){
removeChild(root1.aboutUs);
}else if(root1.displayObject.name==support){
removeChild(root1.support);
}else if(root1.displayObject.name==process){
removeChild(root1.process);
}else if(root1.displayObject.name ==enviroment){
removeChild(root1.enviroment);
} else{ trace(everything clear);
}

That is exactly the structure of what I'm looking for.

Regards,

Gustavo

P.s: this is a wild guess I haven't tried yet.

On Jun 4, 2009, at 4:16 AM, Glen Pike wrote:


Hi,

   Sorry, I just replied to your other thread, but now I see your  
code...


   Try something like this...

   function removeClip(thenameoftheobject) {
  thenameoftheobject.parent.removeChild(thenameoftheobject);
   }

   Glen

Gustavo Duenas wrote:



I have several buttons which create some windows based on a movie  
clip that exports for actioncript.
Everything is ok, with the creation, but when it comes to close  
them ( I have a button in the window itself that

can remove the child), I will trying to do it using actionscript.

if (stage.contains(thenameoftheobject)){
stage.removeChild(thenameoftheobject)}

but so far it isn't working,
Flash is telling me that the display object is not there (course  
is not there until it is created by the button) so everyone knows  
how could I
remove the child from the same buttons without the warning that  
the buttons are not there.


here is my code for the windows. it will explain how I have those  
created.


function newClick(e:MouseEvent){
productsOff();
removerChild()

gotoAndPlay(75);
var newBack:Loader = new Loader();
newBack.load(new URLRequest(imgs/sombrero.jpg));
this.backMovie.addChild(newBack)
var myWindow:AboutUsWindow = new AboutUsWindow();
myWindow.name = e.currentTarget.name;
trace(myWindow.name);
myWindow.x=500.0;
myWindow.y=391.0;
var myText:URLLoader= new URLLoader();
myText.addEventListener(Event.COMPLETE, onLoaded);
function onLoaded(e:Event):void{
myWindow.textoWindow.text= e.target.data;
myScroll.scrollTarget=myWindow.textoWindow;
   }
myText.load(new URLRequest(text/+ e.currentTarget.name 
+.txt));

var myScroll:UIScrollBar = new UIScrollBar();
myScroll.enabled=true;
myScroll.direction= VERTICAL;
myScroll.setSize(myWindow.textoWindow.width,  
myWindow.textoWindow.height);


myScroll.x=300;
myScroll.y=-33;
myScroll.height = myWindow.textoWindow.height;
myWindow.addChild(myScroll);
var myLoader:Loader = new Loader();
myLoader.load(new URLRequest(e.currentTarget.name+.swf));
myWindow.imgScreen.addChild(myLoader);
myWindow.botoncito.buttonMode=true;
myWindow.botoncito.addEventListener(MouseEvent.MOUSE_OVER,  
botoncitoOver);
myWindow.botoncito.addEventListener(MouseEvent.MOUSE_OUT,  
botoncitoOut);
myWindow.botoncito.addEventListener(MouseEvent.CLICK,  
botoncitoClick);

//new botoncitoBehaviour//
function botoncitoOver(e:MouseEvent):void{
e.currentTarget.gotoAndPlay(2);
   }
function botoncitoOut(e:MouseEvent):void{
e.currentTarget.gotoAndStop(1);
}
function botoncitoClick(e:MouseEvent):void{
   removeChild(e.currentTarget.parent);
   }
addChild(myWindow);
}


Any help is appreciated.

Gus


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders






___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] help removing an display object created

2009-06-03 Thread Gustavo Duenas



I have several buttons which create some windows based on a movie  
clip that exports for actioncript.
Everything is ok, with the creation, but when it comes to close them  
( I have a button in the window itself that

can remove the child), I will trying to do it using actionscript.

if (stage.contains(thenameoftheobject)){
stage.removeChild(thenameoftheobject)}

but so far it isn't working,
Flash is telling me that the display object is not there (course is  
not there until it is created by the button) so everyone knows how  
could I
remove the child from the same buttons without the warning that the  
buttons are not there.


here is my code for the windows. it will explain how I have those  
created.


function newClick(e:MouseEvent){
productsOff();
removerChild()

gotoAndPlay(75);
var newBack:Loader = new Loader();
newBack.load(new URLRequest(imgs/sombrero.jpg));
this.backMovie.addChild(newBack)

var myWindow:AboutUsWindow = new AboutUsWindow();
myWindow.name = e.currentTarget.name;
trace(myWindow.name);
myWindow.x=500.0;
myWindow.y=391.0;
var myText:URLLoader= new URLLoader();
myText.addEventListener(Event.COMPLETE, onLoaded);
function onLoaded(e:Event):void{
myWindow.textoWindow.text= e.target.data;
myScroll.scrollTarget=myWindow.textoWindow;

}
myText.load(new URLRequest(text/+ e.currentTarget.name+.txt));
var myScroll:UIScrollBar = new UIScrollBar();
myScroll.enabled=true;
myScroll.direction= VERTICAL;
myScroll.setSize(myWindow.textoWindow.width,  
myWindow.textoWindow.height);


myScroll.x=300;
myScroll.y=-33;
myScroll.height = myWindow.textoWindow.height;
myWindow.addChild(myScroll);
var myLoader:Loader = new Loader();
myLoader.load(new URLRequest(e.currentTarget.name+.swf));
myWindow.imgScreen.addChild(myLoader);
myWindow.botoncito.buttonMode=true;
	myWindow.botoncito.addEventListener(MouseEvent.MOUSE_OVER,  
botoncitoOver);
	myWindow.botoncito.addEventListener(MouseEvent.MOUSE_OUT,  
botoncitoOut);

myWindow.botoncito.addEventListener(MouseEvent.CLICK, botoncitoClick);


//new botoncitoBehaviour//


function botoncitoOver(e:MouseEvent):void{
e.currentTarget.gotoAndPlay(2);

}
function botoncitoOut(e:MouseEvent):void{
e.currentTarget.gotoAndStop(1);
}
function botoncitoClick(e:MouseEvent):void{

removeChild(e.currentTarget.parent);

}
addChild(myWindow);

}


Any help is appreciated.

Gus


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Help jsfl traceBitmap

2009-02-18 Thread Jiri

For the archive. This is the way to do it.

function convert(tFlaPath , tExportPath , tFilename){


	debugMessage += \n Vectorizing file : + tFilename +  on  + (new 
Date()).toGMTString() + \n;

debugMessage += SettingstraceBitmap(100, 2, 'normal' , 'normal') \n;

fl.openDocument(tFlaPath);
fl.outputPanel.clear();


var doc = fl.getDocumentDOM();
var library = doc.library;
var items = library.items.concat();

i = items.length;

while (i--) {

var item = items[i];
var tLayerN;

if (item.itemType == 'movie clip') {
var timeline = item.timeline;
len = timeline.frameCount;

tLayerN = timeline.layers.length;

for(var p=0; ptLayerN; p++) {

fl.trace(layers index  + p);

for(var k=0; klen; k++) {

library.selectItem(item.name);
library.editItem();

timeline.currentFrame = k;
timeline.setSelectedFrames(k,k,true);

if (doc.selection == [object Bitmap]){
fl.trace('converted: ' + doc.selection);
fl.trace('converted: ' + item.name);
doc.traceBitmap(100, 2, 'normal' , 'normal');
}
}

doc.exitEditMode();
}
}
}
filename_new = getNewFileName(tFilename);
targetPath = tExportPath + / + filename_new.toUpperCase1() + .swf
debugMessage += Exportpath : \n + targetPath;


log(tExportPath);

doc.exportSWF(targetPath, true);
doc.close(false);
}



Muzak wrote:

This one threw me off a bit :)
You have to move the timeline playhead for traceBitmap to work.
When you enter edit mode, you automatically end up in the first frame, 
so that's why traceBitmap works for the first frame, and not the others.


So, loop through the number of frames, set timeline.currentFrame and 
then you'll be able to select the elements in that frame and work with 
them.


This should do the trick:

var doc = fl.getDocumentDOM();
var library = doc.library;
var items = library.items.concat();

var i = items.length;
var item;
var timeline;
var len;
var fr;

while (i--) {
item = items[i];
fl.trace(itemType:  + item.itemType);
if (item.itemType == movie clip) {
 library.selectItem(item);
 library.editItem();
 timeline = item.timeline;
 len = timeline.frameCount;
 fl.trace(- frameCount:  + timeline.frameCount);
 for(var j=0; jlen; j++) {
  doc.selectNone();
  // move the playhead !!
  timeline.currentFrame = j;
  // get reference to current frame object
  fr = timeline.layers[0].frames[j];
  // set doc selection
  doc.selection = fr.elements;
  doc.traceBitmap(100, 1, 'pixels', 'normal');
 }
}
}
doc.exitEditMode();

regards,
Muzak

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Help jsfl traceBitmap

2009-02-10 Thread Jiri

Thnx a million !
J

Muzak wrote:
This should work, but should probably build in a few more checks in 
the loop.
Like check if there's a bitmap in the currently editted movieclip in the 
specified frame.


What this does is:
- loop through the items in the library
- check if current item is a movieclip (not a bitmap as you did)
- if movieclip, select it and enter edit mode
- get the movieclip timeline and set the elements  in its first 
frame/first layer as document selection

// here is where you should check if the above selection contains a bitmap
- trace bitmap


var doc = fl.getDocumentDOM();
var library = doc.library;
var items = library.items.concat();

i = items.length;

while (i--) {
var item = items[i];
fl.trace(itemType:  + item.itemType);
if (item.itemType == 'movie clip') {
 library.selectItem(item);
 library.editItem();
 var timeline = item.timeline;
 fl.trace(- frameCount:  + timeline.frameCount);
 doc.selection = timeline.layers[0].frames[0].elements;
 doc.traceBitmap(100, 1, 'pixels', 'normal');
}
}
doc.exitEditMode();


regards,
Muzak

- Original Message - From: Jiri jiriheitla...@googlemail.com
To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Monday, February 09, 2009 9:47 AM
Subject: [Flashcoders] Help jsfl traceBitmap



Hello,

i was wondering if someone can help me out with the following.
I have a the maintimeline with on it a movieclip. Inside this 
movieclip is a png, that I would like to trace as a bitmap.


I can't seem to target the png that is nested in the movieclip. If i 
understand correctly I will first need to get it the timeline of the 
png holder clip from the library and then select the frame. Here is my 
code which throws a selection: Argument number 1 is invalid.


var doc = fl.getDocumentDOM();
var library = doc.library;
var items = library.items.concat();

i = items.length;


while (i--)
{
var item = items[i];
if (item.itemType == 'bitmap')
{
var imageName = item.name.split('.')[0];
var image = doc.getTimeline().layers[0].frames[0].elements[0];
doc.selection = image
doc.traceBitmap(100, 100 , 'normal' , 'normal');
}
}

Hope someone can help!

Jiri
___


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Help jsfl traceBitmap

2009-02-10 Thread Jiri

Muzak and others,

everything worked fine, but now i am struggling with movieclips and 
different frames on their timeline containing 1 png.

I followed your described logic.
1. go trhrough lib items.
2. Check if it is a movieclip.
3. For framecount of the timeline, do a loop.
4. For each frame get the elemtens
5. add this to the selection
6. apply the trace bitmap.
7. ERROR! Selcection not set

Would someone please be so kind to take a look...it is driving me nuts!

Thnx

code
function convert(tFlaPath , tExportPath){

fl.openDocument(tFlaPath);

var doc = fl.getDocumentDOM();
var library = doc.library;
var items = library.items;

i = items.length;

while (i--) {
var item = items[i];

if (item.itemType == 'movie clip') {

var timeline = item.timeline;
var k = timeline.frameCount;

library.selectItem(item);
library.editItem();

while(k--){

var j = timeline.layers[0].frames[k].elements.length

while(j--){
doc.selection =  
timeline.layers[0].frames[k].elements
doc.traceBitmap(100, 1, 'normal', 'normal');
}


}
doc.exitEditMode();
}


}


filename_new = getNewFileName(filename);
targetPath = tExportPath + / + filename_new.toUpperCase1() + .swf
//doc.exportSWF(targetPath, true);
//doc.close(false);
}

/code

Muzak wrote:
This should work, but should probably build in a few more checks in 
the loop.
Like check if there's a bitmap in the currently editted movieclip in the 
specified frame.


What this does is:
- loop through the items in the library
- check if current item is a movieclip (not a bitmap as you did)
- if movieclip, select it and enter edit mode
- get the movieclip timeline and set the elements  in its first 
frame/first layer as document selection

// here is where you should check if the above selection contains a bitmap
- trace bitmap


var doc = fl.getDocumentDOM();
var library = doc.library;
var items = library.items.concat();

i = items.length;

while (i--) {
var item = items[i];
fl.trace(itemType:  + item.itemType);
if (item.itemType == 'movie clip') {
 library.selectItem(item);
 library.editItem();
 var timeline = item.timeline;
 fl.trace(- frameCount:  + timeline.frameCount);
 doc.selection = timeline.layers[0].frames[0].elements;
 doc.traceBitmap(100, 1, 'pixels', 'normal');
}
}
doc.exitEditMode();


regards,
Muzak

- Original Message - From: Jiri jiriheitla...@googlemail.com
To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Monday, February 09, 2009 9:47 AM
Subject: [Flashcoders] Help jsfl traceBitmap



Hello,

i was wondering if someone can help me out with the following.
I have a the maintimeline with on it a movieclip. Inside this 
movieclip is a png, that I would like to trace as a bitmap.


I can't seem to target the png that is nested in the movieclip. If i 
understand correctly I will first need to get it the timeline of the 
png holder clip from the library and then select the frame. Here is my 
code which throws a selection: Argument number 1 is invalid.


var doc = fl.getDocumentDOM();
var library = doc.library;
var items = library.items.concat();

i = items.length;


while (i--)
{
var item = items[i];
if (item.itemType == 'bitmap')
{
var imageName = item.name.split('.')[0];
var image = doc.getTimeline().layers[0].frames[0].elements[0];
doc.selection = image
doc.traceBitmap(100, 100 , 'normal' , 'normal');
}
}

Hope someone can help!

Jiri
___


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Help jsfl traceBitmap

2009-02-10 Thread Muzak

This one threw me off a bit :)
You have to move the timeline playhead for traceBitmap to work.
When you enter edit mode, you automatically end up in the first frame, so that's why traceBitmap works for the first frame, and not 
the others.


So, loop through the number of frames, set timeline.currentFrame and then you'll be able to select the elements in that frame and 
work with them.


This should do the trick:

var doc = fl.getDocumentDOM();
var library = doc.library;
var items = library.items.concat();

var i = items.length;
var item;
var timeline;
var len;
var fr;

while (i--) {
item = items[i];
fl.trace(itemType:  + item.itemType);
if (item.itemType == movie clip) {
 library.selectItem(item);
 library.editItem();
 timeline = item.timeline;
 len = timeline.frameCount;
 fl.trace(- frameCount:  + timeline.frameCount);
 for(var j=0; jlen; j++) {
  doc.selectNone();
  // move the playhead !!
  timeline.currentFrame = j;
  // get reference to current frame object
  fr = timeline.layers[0].frames[j];
  // set doc selection
  doc.selection = fr.elements;
  doc.traceBitmap(100, 1, 'pixels', 'normal');
 }
}
}
doc.exitEditMode();

regards,
Muzak

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Help jsfl traceBitmap

2009-02-10 Thread Jiri

 This one threw me off a bit :)
Tell me about it, it did my head in all day..
 When you enter edit mode, you automatically end up in the first frame,
That explains why, although looping through the frames, it was always 
only the first one to be converted before the error was thrown.


I will give your suggestion a try tomorrow and cross my fingers it works.
Thank you again.

jiri

Muzak wrote:

This one threw me off a bit :)
You have to move the timeline playhead for traceBitmap to work.
When you enter edit mode, you automatically end up in the first frame, 
so that's why traceBitmap works for the first frame, and not the others.


So, loop through the number of frames, set timeline.currentFrame and 
then you'll be able to select the elements in that frame and work with 
them.


This should do the trick:

var doc = fl.getDocumentDOM();
var library = doc.library;
var items = library.items.concat();

var i = items.length;
var item;
var timeline;
var len;
var fr;

while (i--) {
item = items[i];
fl.trace(itemType:  + item.itemType);
if (item.itemType == movie clip) {
 library.selectItem(item);
 library.editItem();
 timeline = item.timeline;
 len = timeline.frameCount;
 fl.trace(- frameCount:  + timeline.frameCount);
 for(var j=0; jlen; j++) {
  doc.selectNone();
  // move the playhead !!
  timeline.currentFrame = j;
  // get reference to current frame object
  fr = timeline.layers[0].frames[j];
  // set doc selection
  doc.selection = fr.elements;
  doc.traceBitmap(100, 1, 'pixels', 'normal');
 }
}
}
doc.exitEditMode();

regards,
Muzak

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Help jsfl traceBitmap

2009-02-09 Thread Jiri

Hello,

i was wondering if someone can help me out with the following.
I have a the maintimeline with on it a movieclip. Inside this movieclip 
is a png, that I would like to trace as a bitmap.


I can't seem to target the png that is nested in the movieclip. If i 
understand correctly I will first need to get it the timeline of the png 
holder clip from the library and then select the frame. Here is my code 
which throws a selection: Argument number 1 is invalid.


var doc = fl.getDocumentDOM();
var library = doc.library;
var items = library.items.concat();

i = items.length;


while (i--)
{
var item = items[i];
if (item.itemType == 'bitmap')
{
var imageName = item.name.split('.')[0];
var image = doc.getTimeline().layers[0].frames[0].elements[0];
doc.selection = image
doc.traceBitmap(100, 100 , 'normal' , 'normal');
}
}

Hope someone can help!

Jiri
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Help jsfl traceBitmap

2009-02-09 Thread Muzak

This should work, but should probably build in a few more checks in the loop.
Like check if there's a bitmap in the currently editted movieclip in the 
specified frame.

What this does is:
- loop through the items in the library
- check if current item is a movieclip (not a bitmap as you did)
- if movieclip, select it and enter edit mode
- get the movieclip timeline and set the elements  in its first frame/first 
layer as document selection
// here is where you should check if the above selection contains a bitmap
- trace bitmap


var doc = fl.getDocumentDOM();
var library = doc.library;
var items = library.items.concat();

i = items.length;

while (i--) {
var item = items[i];
fl.trace(itemType:  + item.itemType);
if (item.itemType == 'movie clip') {
 library.selectItem(item);
 library.editItem();
 var timeline = item.timeline;
 fl.trace(- frameCount:  + timeline.frameCount);
 doc.selection = timeline.layers[0].frames[0].elements;
 doc.traceBitmap(100, 1, 'pixels', 'normal');
}
}
doc.exitEditMode();


regards,
Muzak

- Original Message - 
From: Jiri jiriheitla...@googlemail.com

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Monday, February 09, 2009 9:47 AM
Subject: [Flashcoders] Help jsfl traceBitmap



Hello,

i was wondering if someone can help me out with the following.
I have a the maintimeline with on it a movieclip. Inside this movieclip 
is a png, that I would like to trace as a bitmap.


I can't seem to target the png that is nested in the movieclip. If i 
understand correctly I will first need to get it the timeline of the png 
holder clip from the library and then select the frame. Here is my code 
which throws a selection: Argument number 1 is invalid.


var doc = fl.getDocumentDOM();
var library = doc.library;
var items = library.items.concat();

i = items.length;


while (i--)
{
var item = items[i];
if (item.itemType == 'bitmap')
{
var imageName = item.name.split('.')[0];
var image = doc.getTimeline().layers[0].frames[0].elements[0];
doc.selection = image
doc.traceBitmap(100, 100 , 'normal' , 'normal');
}
}

Hope someone can help!

Jiri
___


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] help stopping an external clip on as3

2009-01-16 Thread Gustavo Duenas



Ok Coders I have a loader which loads a external movieclip, and I  
want it to stop when I say, but unfortunately all my efforts are

useless
I've been using.

in some frame.

myLoader.stop();

and nothing

or myLoader.stop;

and is the same...any ideas?

every time is the same error, someone(there is no reference to stop()  
in the display library???) knows how to stop it?


Gustavo D.


Gustavo A. Duenas

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] help stopping an external clip on as3

2009-01-16 Thread Robert Leisle
Hi Gustavo,

Try this:
var mc:MovieClip = myLoader.content as MovieClip;
mc.stop();

or
MovieClip(myLoader.content).stop();

Either one should work.

hth,
Bob

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Gustavo
Duenas
Sent: Friday, January 16, 2009 10:43 AM
To: Flash Coders List
Subject: [Flashcoders] help stopping an external clip on as3



Ok Coders I have a loader which loads a external movieclip, and I  
want it to stop when I say, but unfortunately all my efforts are
useless
I've been using.

in some frame.

myLoader.stop();

and nothing

or myLoader.stop;

and is the same...any ideas?

every time is the same error, someone(there is no reference to stop()  
in the display library???) knows how to stop it?

Gustavo D.


Gustavo A. Duenas

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Help Please

2008-09-10 Thread Eng. Omar Eltonoby
Hello,
I'm trying to resize the created movie clip (via width and height) but that
seems to have no effect. Is there any restrictions on that?
I tried to resize it using the properties panel dimensions didn't change.

thanks in advance for your help

-- 
Eng. Omar Abouzied Eltonoby
Computer Engineer
Cairo University,Faculty Of Engineering
2008-Graduate
tel. 011-8020617
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Help Please

2008-09-10 Thread Paul Andrews
- Original Message - 
From: Eng. Omar Eltonoby [EMAIL PROTECTED]

To: flashcoders@chattyfig.figleaf.com
Sent: Wednesday, September 10, 2008 4:41 PM
Subject: [Flashcoders] Help Please



Hello,
I'm trying to resize the created movie clip (via width and height) but 
that

seems to have no effect. Is there any restrictions on that?
I tried to resize it using the properties panel dimensions didn't change.


How about scaling the MovieClip?

Check out the MovieClip properties.

Paul


thanks in advance for your help

--
Eng. Omar Abouzied Eltonoby
Computer Engineer
Cairo University,Faculty Of Engineering
2008-Graduate
tel. 011-8020617
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Help Please

2008-09-10 Thread eric e. dolecki
A created mc (with code) has a height and width of 0 until it's populated
with something. If this is something that you created and placed on the
stage, you should be able to use the property inspector to change those.
Eric

On Wed, Sep 10, 2008 at 11:41 AM, Eng. Omar Eltonoby [EMAIL PROTECTED]wrote:

 Hello,
 I'm trying to resize the created movie clip (via width and height) but that
 seems to have no effect. Is there any restrictions on that?
 I tried to resize it using the properties panel dimensions didn't change.

 thanks in advance for your help

 --
 Eng. Omar Abouzied Eltonoby
 Computer Engineer
 Cairo University,Faculty Of Engineering
 2008-Graduate
 tel. 011-8020617
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Help with AS3 Flash NumericStepper component

2008-08-19 Thread jonathan howe
Hi,

AS3, CS3, non-Flex:
I'm trying to use a NumericStepper to cycle through a different range in
different situations. I have the appropriate range in a pseudo-struct called
propertyDefinition. So, I instantiate the NumericStepper and assign it to
the var stepper and apply minimum and maximum numbers:

 stepper.minimum = propertyDefinition.minimum;  // minimum is type
Number
 stepper.value =
_selectedStageObjects.getItemAt(0).data.getProperty(propertyDefinition.propertyName)
as Number;
 stepper.maximum = propertyDefinition.maximum; // maximum is type Number
 stepper.stepSize = propertyDefinition.stepSize;
Great. Works fine for positive minimum and maximum numbers.

Now, when the propertyDefinition.minimum = -1 and the
propertyDefinition.maximum = -50 the resultant numeric stepper is completely
locked down. Regardless of the value, it shows -50 as the value. If I try to
use the step buttons, it stays at -50. If I try to type into the stepper, it
jumps to -1. stepper.nextValue and stepper.previousValue both return the
current value.

Here's the weird part. If I hard code the minimum and maximum:

 stepper.minimum = -1;
 stepper.value =
_selectedStageObjects.getItemAt(0).data.getProperty(propertyDefinition.propertyName)
as Number;
 stepper.maximum = -50;
 stepper.stepSize = propertyDefinition.stepSize;

It works 100% fine. So clearly the NumericStepper can handle stepping
through negative numbers.
I've tried reversing the order I set the value, minimum, maximum, stepSize.
I've tried a negative stepSize. I've tried casting
propertyDefinition.minumum as a Number  (it already is a Number, but I'm
getting superstitious). I just can't possibly understand why if assign
a hard coded a number, I get one behavior and if I assign to a property
value that evaluates to the exact same hard coded number, I get a broken
stepper.

Can anyone see the mistake I'm making? (Including Using the Flash CS3
components in the first place)

-jonathan

-- 
-jonathan howe :: 404.434.2321 :: 180 High St Apt 26 Portland, ME 04101
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Help! Webcam + lineTo on mousemove = webcam freeze

2008-07-05 Thread Alias Cummins
Well for a start, you're going to be creating loads of geometry. Are
you rendering your drawings to bitmaps at all? Sounds like a
performance issue to me. Drawing vector lines takes CPU - this is just
a fact of life.

What I'd recommend is something along these lines:

User presses mouse
User draws with pen tool
User releases mouse
The line drawn is drawn to a bitmap

Repeat.

Does this make sense?

It may not solve your immediate issue with the webcam, but you will
definitely run into it sooner or later.

Hope this helps,
Alias

2008/6/29 Johnny Zen [EMAIL PROTECTED]:
 Hi all

 I am writing an application where I have  a whiteboard and webcam.

 When I freehand draw a lot using lineTo (sprite), the webcam freezes.

 (Drawing.graphics.lineTo(sourcePt.xPos, sourcePt.yPos);) - on mousemove

 Any idea why this would happen ?

 When I am drawing like crazy, I can see my webcam start to slow down
 and then it gives up. - almost like a processing bottleneck ?

 Any help would be cool.


 Thanks
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Help! Webcam + lineTo on mousemove = webcam freeze

2008-06-29 Thread Johnny Zen
Hi all

I am writing an application where I have  a whiteboard and webcam.

When I freehand draw a lot using lineTo (sprite), the webcam freezes.

(Drawing.graphics.lineTo(sourcePt.xPos, sourcePt.yPos);) - on mousemove

Any idea why this would happen ?

When I am drawing like crazy, I can see my webcam start to slow down
and then it gives up. - almost like a processing bottleneck ?

Any help would be cool.


Thanks
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] help again.. NaN

2008-05-17 Thread rlyn ben
need to display number to the resultTxt but when i press the first number it 
displays NaN.. when i enter the second number.. it display the number but with 
the NaN.. :(
stop();
ageField.addEventListener(TextEvent.TEXT_INPUT, convertAge);
function convertAge (event:TextEvent):Number {
 var resultTxt:TextField = new TextField();
 resultTxt.border = true;
 addChild(resultTxt);

 var userAge:Number;
 var ageStr:String;
 ageStr = ageField.text;
 
 userAge = parseInt(ageStr);
 userAge.toString();
 resultTxt.text = String(userAge);
 return userAge;
}



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] help again.. NaN

2008-05-17 Thread Steven Sacks
Your textfield is probably set to multiline or something like that.  
Anything like a carriage return will cause parseInt to break.


rlyn ben wrote:

need to display number to the resultTxt but when i press the first number it 
displays NaN.. when i enter the second number.. it display the number but with 
the NaN.. :(
stop();
ageField.addEventListener(TextEvent.TEXT_INPUT, convertAge);
function convertAge (event:TextEvent):Number {
 var resultTxt:TextField = new TextField();
 resultTxt.border = true;
 addChild(resultTxt);

 var userAge:Number;
 var ageStr:String;
 ageStr = ageField.text;
 
 userAge = parseInt(ageStr);

 userAge.toString();
 resultTxt.text = String(userAge);
 return userAge;
}


  
___

Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

  


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] help again.. NaN

2008-05-17 Thread Juan Pablo Califano
It seems like the TEXT_INPUT event is fired before the .text property is set
with the user's input. So, when you try to read the value from the text
input, it returns an empty string; which, parsed as an integer, returns NaN.

So, you have get the current input char from the event.text field, and check
if the input text has a lenght  0.

You can try something like this:

stop();

ageField.addEventListener(TextEvent.TEXT_INPUT, convertAge);

function convertAge(event:TextEvent):void {

 trace(ageField.text.length:+ageField.text.length);

 var resultTxt:TextField = new TextField();
 resultTxt.border = true;
 addChild(resultTxt);

 var inputChar:String = event.text;

 if(ageField.text.length  0) {
  resultTxt.text = (parseInt(ageField.text) + inputChar).toString();
 } else {
  resultTxt.text = inputChar;
 }
}
Cheers
Juan Pablo Califano


2008/5/17, Steven Sacks [EMAIL PROTECTED]:

 Your textfield is probably set to multiline or something like that.
  Anything like a carriage return will cause parseInt to break.

 rlyn ben wrote:

 need to display number to the resultTxt but when i press the first number
 it displays NaN.. when i enter the second number.. it display the number but
 with the NaN.. :(
 stop();
 ageField.addEventListener(TextEvent.TEXT_INPUT, convertAge);
 function convertAge (event:TextEvent):Number {
  var resultTxt:TextField = new TextField();
  resultTxt.border = true;
  addChild(resultTxt);

  var userAge:Number;
  var ageStr:String;
  ageStr = ageField.text;
   userAge = parseInt(ageStr);
  userAge.toString();
  resultTxt.text = String(userAge);
  return userAge;
 }


  ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] help again.. NaN

2008-05-17 Thread Juan Pablo Califano
PD:

Actually, the parseInt part is not needed if you are going to manipulate the
input as text...

So, you can change this line:
resultTxt.text = (parseInt(ageField.text) + inputChar).toString();

to:
resultTxt.text = ageField.text + inputChar;

Since parseInt(ageField.text) is converted to a string anyway before being
concatenated to inputChar.

You should also restrict the input text to accept only numbers or validate
the input by yourself.

Cheers
Juan Pablo Califano

2008/5/17, Juan Pablo Califano [EMAIL PROTECTED]:

 It seems like the TEXT_INPUT event is fired before the .text property is
 set with the user's input. So, when you try to read the value from the text
 input, it returns an empty string; which, parsed as an integer, returns NaN.

 So, you have get the current input char from the event.text field, and
 check if the input text has a lenght  0.

 You can try something like this:

 stop();

 ageField.addEventListener(TextEvent.TEXT_INPUT, convertAge);

 function convertAge(event:TextEvent):void {

  trace(ageField.text.length:+ageField.text.length);

  var resultTxt:TextField = new TextField();
  resultTxt.border = true;
  addChild(resultTxt);

  var inputChar:String = event.text;

  if(ageField.text.length  0) {
   resultTxt.text = (parseInt(ageField.text) + inputChar).toString();
  } else {
   resultTxt.text = inputChar;
  }
 }
 Cheers
 Juan Pablo Califano


 2008/5/17, Steven Sacks [EMAIL PROTECTED]:

 Your textfield is probably set to multiline or something like that.
  Anything like a carriage return will cause parseInt to break.

 rlyn ben wrote:

 need to display number to the resultTxt but when i press the first number
 it displays NaN.. when i enter the second number.. it display the number but
 with the NaN.. :(
 stop();
 ageField.addEventListener(TextEvent.TEXT_INPUT, convertAge);
 function convertAge (event:TextEvent):Number {
  var resultTxt:TextField = new TextField();
  resultTxt.border = true;
  addChild(resultTxt);

  var userAge:Number;
  var ageStr:String;
  ageStr = ageField.text;
   userAge = parseInt(ageStr);
  userAge.toString();
  resultTxt.text = String(userAge);
  return userAge;
 }


  ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] help again.. NaN

2008-05-17 Thread Steven Sacks
You can just cast it as int and it will resolve as 0 if it's empty 
string or contains non-numeric characters.

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] help again.. NaN

2008-05-17 Thread rlyn ben
yes.. thank you so much.. this helps alot.. (^_^).. i do need to convert the 
string to number coz i have to add it up with values from radiobuttons.. and oh 
yea.. i got one more problem then im done.. sorry if i ask novice questions.. 
im just new to as3.. and willing to learn more.. enhance what i started now..


- Original Message 
From: Juan Pablo Califano [EMAIL PROTECTED]
To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Saturday, May 17, 2008 3:14:48 PM
Subject: Re: [Flashcoders] help again.. NaN

It seems like the TEXT_INPUT event is fired before the .text property is set
with the user's input. So, when you try to read the value from the text
input, it returns an empty string; which, parsed as an integer, returns NaN.

So, you have get the current input char from the event.text field, and check
if the input text has a lenght  0.

You can try something like this:

stop();

ageField.addEventListener(TextEvent.TEXT_INPUT, convertAge);

function convertAge(event:TextEvent):void {

trace(ageField.text.length:+ageField.text.length);

var resultTxt:TextField = new TextField();
resultTxt.border = true;
addChild(resultTxt);

var inputChar:String = event.text;

if(ageField.text.length  0) {
  resultTxt.text = (parseInt(ageField.text) + inputChar).toString();
} else {
  resultTxt.text = inputChar;
}
}
Cheers
Juan Pablo Califano


2008/5/17, Steven Sacks [EMAIL PROTECTED]:

 Your textfield is probably set to multiline or something like that.
  Anything like a carriage return will cause parseInt to break.

 rlyn ben wrote:

 need to display number to the resultTxt but when i press the first number
 it displays NaN.. when i enter the second number.. it display the number but
 with the NaN.. :(
 stop();
 ageField.addEventListener(TextEvent.TEXT_INPUT, convertAge);
 function convertAge (event:TextEvent):Number {
  var resultTxt:TextField = new TextField();
  resultTxt.border = true;
  addChild(resultTxt);

  var userAge:Number;
  var ageStr:String;
  ageStr = ageField.text;
   userAge = parseInt(ageStr);
  userAge.toString();
  resultTxt.text = String(userAge);
  return userAge;
 }


  ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



  
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Help needed AS3 -- [Embed(source='library.swf' symbol='backgroud_mc')]

2008-03-24 Thread Cor
Hi list,

I have a library.swf with a movie clip Background_mc in the library
I am trying to embed from this swf into another through a class.
In this  document class I do:
[Embed(source='library.swf'  symbol='Backgroud_mc')]
Private var Background_mc:Class;
Private var _myBG:MovieClip

Function init():void{
myBG = new  Background_mc();
addChild(myBG)
}

This throws an error:
TypeError: Error #1007: Instantiation attempted on a non-constructor.

What am I doing wrong?

No virus found in this outgoing message.
Checked by AVG. 
Version: 7.5.519 / Virus Database: 269.21.8/1340 - Release Date: 23-3-2008
18:50
 

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Help needed AS3 -- [Embed(source='library.swf' symbol='backgroud_mc')]

2008-03-24 Thread Glen Pike

Try

_myBG = new instead of myBG = new


Cor wrote:

Hi list,

I have a library.swf with a movie clip Background_mc in the library
I am trying to embed from this swf into another through a class.
In this  document class I do:
[Embed(source='library.swf'  symbol='Backgroud_mc')]
Private var Background_mc:Class;
Private var _myBG:MovieClip

Function init():void{
myBG = new  Background_mc();
addChild(myBG)
}

This throws an error:
TypeError: Error #1007: Instantiation attempted on a non-constructor.

What am I doing wrong?

No virus found in this outgoing message.
Checked by AVG. 
Version: 7.5.519 / Virus Database: 269.21.8/1340 - Release Date: 23-3-2008

18:50
 


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


  


--

Glen Pike
01736 759321
www.glenpike.co.uk http://www.glenpike.co.uk
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Help needed AS3 -- [Embed(source='library.swf'symbol='backgroud_mc')]

2008-03-24 Thread Cor
I know, typo in this topic mail but not in my class.
Thanks! 

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Namens Glen Pike
Verzonden: maandag 24 maart 2008 14:16
Aan: Flash Coders List
Onderwerp: Re: [Flashcoders] Help needed AS3 --
[Embed(source='library.swf'symbol='backgroud_mc')]

Try

_myBG = new instead of myBG = new


Cor wrote:
 Hi list,

 I have a library.swf with a movie clip Background_mc in the library I 
 am trying to embed from this swf into another through a class.
 In this  document class I do:
 [Embed(source='library.swf'  symbol='Backgroud_mc')] Private var 
 Background_mc:Class; Private var _myBG:MovieClip

 Function init():void{
   myBG = new  Background_mc();
   addChild(myBG)
 }

 This throws an error:
 TypeError: Error #1007: Instantiation attempted on a non-constructor.

 What am I doing wrong?

 No virus found in this outgoing message.
 Checked by AVG. 
 Version: 7.5.519 / Virus Database: 269.21.8/1340 - Release Date: 
 23-3-2008 18:50
  

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


   

-- 

Glen Pike
01736 759321
www.glenpike.co.uk http://www.glenpike.co.uk
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


--
No virus found in this incoming message.
Checked by AVG. 
Version: 7.5.519 / Virus Database: 269.21.8/1340 - Release Date: 23-3-2008
18:50


No virus found in this incoming message.
Checked by AVG. 
Version: 7.5.519 / Virus Database: 269.21.8/1340 - Release Date: 23-3-2008
18:50
 

No virus found in this outgoing message.
Checked by AVG. 
Version: 7.5.519 / Virus Database: 269.21.8/1340 - Release Date: 23-3-2008
18:50
 

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Help needed AS3 -- [Embed(source='library.swf' symbol='backgroud_mc')]

2008-03-24 Thread Jon Bradley


On Mar 24, 2008, at 8:30 AM, Cor wrote:



This throws an error:
TypeError: Error #1007: Instantiation attempted on a non-constructor.

What am I doing wrong?



You can't call new Background_mc() when it's an instance of Class -  
there's no constructor for it that the compiler recognizes.


My suggestion if you don't need to extend UIMovieClip is as follows.

In your Library.fla file, check your export for the Background_mc  
symbol.


Give it a class name (com.something.myBackground) and have it extend  
flash.display.MovieClip.


Export an SWC of the Library file and then set your compiler prefs to  
include that SWC into the project.


Then, in your class just do:

import com.something.myBackground

and the usage is:

private var myBG : MovieClip;
private var Background_mc:MovieClip;

myBG = MovieClip( new Background_mc() );

At least, that's one way of doing it. I do it that way for non- 
component UI elements that do not need to extend UIMovieClip. Also  
because I use the same SWC as an SWF file for CSS embedding of  
graphical elements.


good luck,

jon

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Help needed AS3 -- [Embed(source='library.swf' symbol='backgroud_mc')]

2008-03-24 Thread Glen Pike

Hi,

   When Embedding symbols in AS3, you do construct instances of your 
assets using new VariableName -


   http://www.bit-101.com/blog/?p=853

   However, I don't think that the Flash IDE supports this as it does 
not support the [Embed] metadata type...
  
   The only way around this is to use Flash Develop or Flex to create 
your app.


   http://www.actionscript.org/forums/showthread.php3?t=134499

   Glen

Jon Bradley wrote:


On Mar 24, 2008, at 8:30 AM, Cor wrote:



This throws an error:
TypeError: Error #1007: Instantiation attempted on a non-constructor.

What am I doing wrong?



You can't call new Background_mc() when it's an instance of Class - 
there's no constructor for it that the compiler recognizes.


My suggestion if you don't need to extend UIMovieClip is as follows.

In your Library.fla file, check your export for the Background_mc symbol.

Give it a class name (com.something.myBackground) and have it extend 
flash.display.MovieClip.


Export an SWC of the Library file and then set your compiler prefs to 
include that SWC into the project.


Then, in your class just do:

import com.something.myBackground

and the usage is:

private var myBG : MovieClip;
private var Background_mc:MovieClip;

myBG = MovieClip( new Background_mc() );

At least, that's one way of doing it. I do it that way for 
non-component UI elements that do not need to extend UIMovieClip. Also 
because I use the same SWC as an SWF file for CSS embedding of 
graphical elements.


good luck,

jon

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




--

Glen Pike
01736 759321
www.glenpike.co.uk http://www.glenpike.co.uk
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Help needed AS3 -- [Embed(source='library.swf' symbol='backgroud_mc')]

2008-03-24 Thread Jon Bradley
Oops... my last email was kinda based on the idea that you were  
running this in Flex.


My bad - replying to two lists at once.

http://www.digitalflipbook.com/archives/2007/03/associating_cus.php

- jb

On Mar 24, 2008, at 8:30 AM, Cor wrote:

This throws an error:
TypeError: Error #1007: Instantiation attempted on a non-constructor.

What am I doing wrong?

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Help Needed. UILoader coordinate track problem on MOUSE_UP

2008-02-26 Thread anuj sharma
Hi All
I am dragging the UI loader component containing external SWfs in them. On
Mouse Release I use stop drag, and on stop drag- I am using
myUIloader.move(mouseX,mouseY).
However the output is little bouncy, the stage is taking the topleft corner
of UIloader as main point and on stop drag it is moving the top left corner
of the UIloader to the point where I left my mouse which gives the bouncy
effect.(In short it is not dropping UIloader where I am leaving my mouse but
dropping the top left corner of UIloader where I left the mouse.)

I came up with the weird temporary solution where I use
myUIloader.move(mouseX-200,mouseY-200)
which is not genuine way of solving this problem.
Can you please help me out for figuring this thing out? All I need is to
drop my UILoader wherever I left my mouse.
Guys,I highly appreciate your help in this matter .
Thanks
Anuj
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] help with flash project

2008-01-27 Thread Michelon Jeanty
Hi everyone, my name is Michelin; I'm a Harvard student, and also a
member of the mailing list.
I'm looking for partners to start an interesting project. Let me know
if any of you guys interested, and we can chat.

It's an open source project/startup. All of our work would be
available to the open source community.

We'll give you 10 shares to start with, it's a good chunk of the
project/startup. You'll also have stock options. Let me know if you
would take me on the offer. You can work with us at your own time.
Email me to negotiate...

You must be very good with red5, Flash media server, OpenLaszlo,
ActionScript, AJAX, Adobe Flex, MXML, PHP (web development).

The idea is an interactive live video streaming project where users
group up to discuss things they care about, using voice and distance.
It's see me; talk to me; locate me live. It's in its stealth mode.

Drop me a line at: [EMAIL PROTECTED]
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Help in bytes reading with AS3

2008-01-14 Thread Flap Flap
Hi there,

I'm starting a new personnal project and I need to be able to read bytes
from a file to extract infos.
Beacause I'm not familiar with this type of manipulation.
So any of you know some good helper classes and / or tuts it will be good :)

Thanks to all

-- 
Benoît Milgram / Flapflap
http://www.kilooctet.net

I'm also a music mashup / bootlegs producer :
http://www.djgaston.net
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Help in bytes reading with AS3

2008-01-14 Thread Merrill, Jason
To: flashcoders@chattyfig.figleaf.com; FlexCoders; Open 
Source Flash Mailing List

Please don't cross post. Thank you,


Jason Merrill
Bank of America  
GTO LLD Solutions Design  Development 
eTools  Multimedia 

Bank of America Flash Platform Developer Community


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Help with listener for custom class (AS3)

2007-09-13 Thread Rob Romanek

Hi Dane,

Here are some thoughts for you to try. First off since you are not  
actually working with a display object you don't need this class to extend  
sprite. The easiest way to give the class the ability to send out events  
is to have it extend EventDispatcher and then you can have it dispatch  
events as required...  here is you sample pared down a bit, just dealing  
with xml


package {
import flash.events.*;
import flash.net.*;
public class fileImports extends EventDispatcher {
public var newStyleSheet:StyleSheet = new StyleSheet();
public var newXML:XML = new XML();
public function fileImports(xmlFile:String):void {
var xmlToLoad:URLRequest=new URLRequest(xmlFile);
var xmlLoader:URLLoader = new URLLoader;

xmlLoader.load(xmlToLoad);
//event listeners
xmlLoader.addEventListener(Event.COMPLETE,xmlLoaded);

}

public function xmlLoaded(event:Event):void {
newXML = XML(event.target.data);
dispatchEvent(new Event(Event.COMPLETE));
}
}
}

then in the movie calling the class

var tFile = new fileImports(data/xml/presenter1.xml);
tFile.addEventListener(Event.COMPLETE, xmlDone);
function xmlDone(e:Event){
trace(done);
}

hth,

Rob

On Tue, 11 Sep 2007 15:25:05 -0400, Dane Williams [EMAIL PROTECTED]  
wrote:



My problem is I don't know how to listen to the class
from the main timeline to find out if the class is finished processing  
the
XML. Right now if I try to use fileForThis.newXML I get a value of  
null.
But if I put a trace on newXML in the class, it shows the content of my  
XML

file.
I have gotten this to work on other projects because I haven't tried to  
use

the data immediately - so the data has time to process before it's put
into a text field, etc.
I appreciate any help I can get on this. Thanks!

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
___
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] Help with listener for custom class (AS3)

2007-09-12 Thread Dane Williams
Greetings All,
I'm trying to do more and more of my projects with external classes and,
along with that, creating classes for routines that I regularly do. I have a
class that reads an XML file and CSS file once it's called. It has worked
fine for the first few projects I used it in. With my recent project, it's
not wanted to behave. The code for the class is as follows:
package {
 import flash.display.Sprite;
 import flash.text.StyleSheet;
 import flash.events.*;
 import flash.net.*;
 public class fileImports extends Sprite {
  public var newStyleSheet:StyleSheet = new StyleSheet();
  public var newXML:XML = new XML();
  public function fileImports(xmlFile:String, cssFile:String):void {
   //load css file
   var cssToLoad:URLRequest=new URLRequest(cssFile);
   var cssLoader:URLLoader = new URLLoader;
   cssLoader.load(cssToLoad);
   //load xml file
   var xmlToLoad:URLRequest=new URLRequest(xmlFile);
   var xmlLoader:URLLoader = new URLLoader;;
   xmlLoader.load(xmlToLoad);
   //event listeners
   xmlLoader.addEventListener(Event.COMPLETE,xmlLoaded);
   cssLoader.addEventListener(Event.COMPLETE, cssLoaded);
  }
  public function cssLoaded(event:Event):void {
   newStyleSheet.parseCSS(event.target.data);
  }
  public function xmlLoaded(event:Event):void {
   newXML = XML(event.target.data);
  }
 }
} 
 
I am creating an instance on my main timeline with this:
var fileForThis:fileImports = new
fileImports(courseInfo.xml,styles.css);
 
I am trying to use the data that is coming in with the XML file to populate
some combo boxes. My problem is I don't know how to listen to the class
from the main timeline to find out if the class is finished processing the
XML. Right now if I try to use fileForThis.newXML I get a value of null.
But if I put a trace on newXML in the class, it shows the content of my XML
file.
 
I have gotten this to work on other projects because I haven't tried to use
the data immediately - so the data has time to process before it's put
into a text field, etc.
 
I appreciate any help I can get on this. Thanks!
 

D. Dane Williams
The Learning Center
Buckman Laboratories, International
901-272-6774 

 
___
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] Help with listener for custom class (AS3)

2007-09-12 Thread Arul Prasad M L
From your cssLoaded and xmlLoaded methods, dispatch an event each,
announcing the completion of load.

eg

 public function xmlLoaded(event:Event):void {
  newXML = XML(event.target.data);
  dispatchEvent(new Event(xmlLoaded));
 }


And on the timeline, you can add a listener to that event by doing this:

var fileForThis:fileImports = new
fileImports(courseInfo.xml,styles.css);
fileForThis.addEventListener(xmlLoaded, onXMLLoad);

function onXMLLoad()
{
// xml loaded now
}

Of course thats not the best way to code ( you could create a custom event
object to pass more data etc, ) but the above should get you started.

Btw, your 'fileImports' class doesnt seem to be a UI class, so you dont have
to extend it from Sprite. Just extend EventDispatcher class.

~Arul Prasad.

On 9/12/07, Dane Williams [EMAIL PROTECTED] wrote:

 Greetings All,
 I'm trying to do more and more of my projects with external classes and,
 along with that, creating classes for routines that I regularly do. I have
 a
 class that reads an XML file and CSS file once it's called. It has worked
 fine for the first few projects I used it in. With my recent project, it's
 not wanted to behave. The code for the class is as follows:
 package {
 import flash.display.Sprite;
 import flash.text.StyleSheet;
 import flash.events.*;
 import flash.net.*;
 public class fileImports extends Sprite {
   public var newStyleSheet:StyleSheet = new StyleSheet();
   public var newXML:XML = new XML();
   public function fileImports(xmlFile:String, cssFile:String):void {
//load css file
var cssToLoad:URLRequest=new URLRequest(cssFile);
var cssLoader:URLLoader = new URLLoader;
cssLoader.load(cssToLoad);
//load xml file
var xmlToLoad:URLRequest=new URLRequest(xmlFile);
var xmlLoader:URLLoader = new URLLoader;;
xmlLoader.load(xmlToLoad);
//event listeners
xmlLoader.addEventListener(Event.COMPLETE,xmlLoaded);
cssLoader.addEventListener(Event.COMPLETE, cssLoaded);
   }
   public function cssLoaded(event:Event):void {
newStyleSheet.parseCSS(event.target.data);
   }
   public function xmlLoaded(event:Event):void {
newXML = XML(event.target.data);
   }
 }
 }

 I am creating an instance on my main timeline with this:
 var fileForThis:fileImports = new
 fileImports(courseInfo.xml,styles.css);

 I am trying to use the data that is coming in with the XML file to
 populate
 some combo boxes. My problem is I don't know how to listen to the class
 from the main timeline to find out if the class is finished processing the
 XML. Right now if I try to use fileForThis.newXML I get a value of null.
 But if I put a trace on newXML in the class, it shows the content of my
 XML
 file.

 I have gotten this to work on other projects because I haven't tried to
 use
 the data immediately - so the data has time to process before it's put
 into a text field, etc.

 I appreciate any help I can get on this. Thanks!


 D. Dane Williams
 The Learning Center
 Buckman Laboratories, International
 901-272-6774


 ___
 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




-- 
Arul Prasad
http://arulprasad.blogspot.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] help with a thread in cs3

2007-06-16 Thread Gustavo Duenas
hi coders I have this code and I'd like to have the loader to some  
new size but thing are not going as expected, the code is:



package {
import flash.display.Sprite;
import flash.display.*;
import flash.events.*;
import flash.accessibility.*;
import com.adobe.viewsource.ViewSource;
import flash.net.*;
import flash.geom.*;
import flash.text.*;
import flash.net.URLRequest;
import flash.net.*;



public class wholeImage1 extends Sprite
{
public function wholeImage1()
{

//inserting image as background;
var backLoader:Loader = new Loader();
			backLoader.load(new URLRequest(http://leftandrightsolutions.com/ 
backy1.jpg));

backLoader.x=-200;
backLoader.y=0;
addChild(backLoader);



}
}
}


I want to do something like this backloader.width= 1440;
 backloader.height=600;
and when I finally used it doesn't work, you know how could do I?


Regards


Gustavo Duenas


___
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] help with a thread in cs3

2007-06-16 Thread David Ngo
You need to add an event listener for when the image load is complete.

package {
import flash.display*;
import flash.events.*;
import flash.net.*;
import flash.geom.*;

public class WholeImage extends Sprite
{
private var backLoader:Loader;

public function WholeImage()
{
backLoader = new Loader();
backLoader.addEventListener(Event.COMPLETE,
onImageComplete);
backLoader.load(new
URLRequest(http://leftandrightsolutions.com/ 
backy1.jpg));
}

private function onImageComplete(event:Event):void
{
backLoader.x = -200;
backLoader.y = 0;
addChild(backLoader);
}
}
}




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Gustavo
Duenas
Sent: Saturday, June 16, 2007 7:15 PM
To: Flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] help with a thread in cs3

hi coders I have this code and I'd like to have the loader to some  
new size but thing are not going as expected, the code is:


package {
import flash.display.Sprite;
import flash.display.*;
import flash.events.*;
import flash.accessibility.*;
import com.adobe.viewsource.ViewSource;
import flash.net.*;
 import flash.geom.*;
 import flash.text.*;
 import flash.net.URLRequest;
 import flash.net.*;



public class wholeImage1 extends Sprite
{
public function wholeImage1()
{

//inserting image as background;
var backLoader:Loader = new Loader();
backLoader.load(new
URLRequest(http://leftandrightsolutions.com/ 
backy1.jpg));
backLoader.x=-200;
backLoader.y=0;
addChild(backLoader);



}
}
}


I want to do something like this backloader.width= 1440;
  backloader.height=600;
and when I finally used it doesn't work, you know how could do I?


Regards


Gustavo Duenas


___
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@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] Help with Flash Video Encoding

2007-06-15 Thread Guy Parton
Evening Everyone,
 
Just wanted to know how to convert / encode an AVI that has been pre-edit in
wide screen format into a FLV whilst retaining its' aspect ratio. I have
been recently tinkering with the Flash 8 Video Encoder and do not seem to be
coming right. Any assistance in this regard would be greatly appreciated.
 
Regards
 
Guy :)
___
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] Help with Flash Video Encoding

2007-06-15 Thread Palmer, Jim
Check out http://ffmpeg.mplayerhq.hu/

It's complicated because it's on the command line - and suited for UNIX. There 
are several Free open sourced UIs that use FFMPEG... so search around for it. 
I've never seen anything as robust and free when it comes to converting video 
formats.

--
Jim Palmer ! Mammoth Web Operations

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of Guy
 Parton
 Sent: Wednesday, June 13, 2007 2:11 PM
 To: flashcoders@chattyfig.figleaf.com
 Subject: [Flashcoders] Help with Flash Video Encoding 
 
 
 Evening Everyone,
  
 Just wanted to know how to convert / encode an AVI that has 
 been pre-edit in
 wide screen format into a FLV whilst retaining its' aspect 
 ratio. I have
 been recently tinkering with the Flash 8 Video Encoder and do 
 not seem to be
 coming right. Any assistance in this regard would be greatly 
 appreciated.
  
 Regards
  
 Guy :)
___
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] Help me disect some Flash work please?

2007-05-30 Thread LHWH Interactive

These three presentations really have nothing in common except a
couple of things I'm trying to figure out, but haven't ever actually
done before, so I'm kinda lost.

What I'm most interested in is, how *technically* do they synchronize
the sound so well to the animation? I notice that no matter what kind
of connection you're on, they all seem to run pretty well, and seemed
to be synchronized pretty well.

Have they split the soundtrack into smaller chunks?
Are they somehow using cuepoints and actionscript to direct the
animation and timeline?

In my head, I see the sound as a separate movieclip that's being
loaded with actionscript, and then cuepoints in the audio are kicking
the playhead forward thru an animation, then stopping the playhead to
wait for another cue. Am I close?

How would you set these up, technically speaking, from a production standpoint?

Please, I know the design of them is all over the map, and I'm aware
that there's actual video (greenscreened) in one, but generally, they
all seem kinda like the same beast.

Has anyone put together one of these sort of powerpoint-y
presentations using flash with a voiceover track and synchronized
animation to it? What pitfalls and advice could you offer? I'm fairly
good at general Flash, and I don't think this is beyond my realm of
work in Flash. I'm a programmer who would be relying on an art
department to provide all the media, but I'm just not sure how to set
it up... does this make sense?

Below are three of these types of presentations that I was just
randomly able to locate, but this is almost exactly what we want to
try...

http://www.dv3productions.com/E2IT/

http://software.emc.com/products/software_az/replistor.htm
(on this page, click on the orange box labeled View product demo)

http://www.angelvisiontech.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] Help me disect some Flash work please?

2007-05-30 Thread Mark Winterhalder

I'm a programmer who would be relying on an art
department to provide all the media, but I'm just not sure how to set
it up... does this make sense?


...and being a programmer is why you don't know how to do it. :)

I'm not sure anymore (too much of a programmer that shuns the timeline
myself), but you can have sound on the timeline. You'll see the wave
form on the timeline when you got it right, IIRC. That way, the
framerate is enforced (the only way to enforce a certain framerate
that I know of), meaning, the sound will play and frames are skipped
if rendering doesn't keep up.

So, there's not much to do for you. Odds are, if you tell the art
department to have some sound on the timeline and then add
synchronized animation to it, they'll automatically do it right
without further instructions. This is classic Flash -- remember it
used to be an animation tool and you need to be able to sync sound to
an animation for it to be useful.

The alternative probably would be to read the position in the clip and
jump to the theoretical frame of the animation, or to have a FLV with
metadata events at certain timestamps. Check out
http://inlet-media.de/flvtool2.

HTH,
Mark



On 5/30/07, LHWH Interactive [EMAIL PROTECTED] wrote:

These three presentations really have nothing in common except a
couple of things I'm trying to figure out, but haven't ever actually
done before, so I'm kinda lost.

What I'm most interested in is, how *technically* do they synchronize
the sound so well to the animation? I notice that no matter what kind
of connection you're on, they all seem to run pretty well, and seemed
to be synchronized pretty well.

Have they split the soundtrack into smaller chunks?
Are they somehow using cuepoints and actionscript to direct the
animation and timeline?

In my head, I see the sound as a separate movieclip that's being
loaded with actionscript, and then cuepoints in the audio are kicking
the playhead forward thru an animation, then stopping the playhead to
wait for another cue. Am I close?

How would you set these up, technically speaking, from a production standpoint?

Please, I know the design of them is all over the map, and I'm aware
that there's actual video (greenscreened) in one, but generally, they
all seem kinda like the same beast.

Has anyone put together one of these sort of powerpoint-y
presentations using flash with a voiceover track and synchronized
animation to it? What pitfalls and advice could you offer? I'm fairly
good at general Flash, and I don't think this is beyond my realm of
work in Flash. I'm a programmer who would be relying on an art
department to provide all the media, but I'm just not sure how to set
it up... does this make sense?

Below are three of these types of presentations that I was just
randomly able to locate, but this is almost exactly what we want to
try...

http://www.dv3productions.com/E2IT/

http://software.emc.com/products/software_az/replistor.htm
(on this page, click on the orange box labeled View product demo)

http://www.angelvisiontech.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@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] Help me disect some Flash work please?

2007-05-30 Thread Muzak
The first one is different from the other 2.
First one uses real video, converted to FLV (you can grab the FLV file from 
your browser cache).
Or grab it here:
http://www.dv3productions.com/E2IT/E2IT_INTRO_w_audio7.flv

The others are more powerpoint-type animations, which you can either create in 
Flash (using the timeline and streaming sound) or use 
one of the many tools out there to create these kind of presentations.

Captivate
http://www.adobe.com/products/captivate/
Camtasia
http://www.techsmith.com/camtasia.asp
etc..


- Original Message - 
From: LHWH Interactive [EMAIL PROTECTED]
To: flashcoders@chattyfig.figleaf.com
Sent: Wednesday, May 30, 2007 5:24 PM
Subject: [Flashcoders] Help me disect some Flash work please?


 These three presentations really have nothing in common except a
 couple of things I'm trying to figure out, but haven't ever actually
 done before, so I'm kinda lost.

 What I'm most interested in is, how *technically* do they synchronize
 the sound so well to the animation? I notice that no matter what kind
 of connection you're on, they all seem to run pretty well, and seemed
 to be synchronized pretty well.

 Have they split the soundtrack into smaller chunks?
 Are they somehow using cuepoints and actionscript to direct the
 animation and timeline?

 In my head, I see the sound as a separate movieclip that's being
 loaded with actionscript, and then cuepoints in the audio are kicking
 the playhead forward thru an animation, then stopping the playhead to
 wait for another cue. Am I close?

 How would you set these up, technically speaking, from a production 
 standpoint?

 Please, I know the design of them is all over the map, and I'm aware
 that there's actual video (greenscreened) in one, but generally, they
 all seem kinda like the same beast.

 Has anyone put together one of these sort of powerpoint-y
 presentations using flash with a voiceover track and synchronized
 animation to it? What pitfalls and advice could you offer? I'm fairly
 good at general Flash, and I don't think this is beyond my realm of
 work in Flash. I'm a programmer who would be relying on an art
 department to provide all the media, but I'm just not sure how to set
 it up... does this make sense?

 Below are three of these types of presentations that I was just
 randomly able to locate, but this is almost exactly what we want to
 try...

 http://www.dv3productions.com/E2IT/

 http://software.emc.com/products/software_az/replistor.htm
 (on this page, click on the orange box labeled View product demo)

 http://www.angelvisiontech.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] Help me disect some Flash work please?

2007-05-30 Thread LHWH Interactive

On 5/30/07, Muzak [EMAIL PROTECTED] wrote:

The others are more powerpoint-type animations, which you can either create in 
Flash (using the timeline and streaming sound)


So you're on the same page as Mark, above? embed the sound directly
into the timeline and just animate around it? When the soundfile says,
It's Quick, It's Easy... or something along those lines, you'd just
animate your text to appear in time with the timeline?

How can I be sure that... okay, let's say at some point in the
voiceover, like above, there's a certain phrase you wanna animate
against. Let's say for the sake of argument it's a point where he/she
says something like, It's cheap, it's easy, and best of all, it'll
save you money! and you want those words to appear, then fade away,
then appear, then fade away, all synchronized to the voiceover track.

It's as easy as both of you are saying? Just drop the sound track into
the timeline and animate?

Let's say for the sake of argument, that the soundtrack is two, or
three minutes long... do you break up the file into smaller chunks? Or
is it okay to just import the whole sound at once? What are the
drawbacks/benefits to doing it either way?

It sure sounds like I'm just overthinking it... what with cuepoints,
actionscripting and the like. It sounds more and more like it's just
your basic, average, timeline based presentation that's about 4000
frames of animation and timeline mess. Maybe a pain to keep track of,
but little to no programming

Am I on the right track?
___
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] HELP!! cannot seem to embed fonts

2007-05-23 Thread a

mx:Style
   @font-face{
  src: url(./assets/ARIAL.TTF);
 fontFamily: aArial;
 fontStyle: regular;
}
   
   .mystyle1 {

   fontFamily:aArial;
   fontSize: 12pt;
   }
   /mx:Style

mx:Panel x=40.5 y=22 width=325.5 height=268 layout=absolute 
backgroundAlpha=0 
   horizontalAlign=center horizontalScrollPolicy=off 
verticalScrollPolicy=off title=test embed
   id=d_mail color=#FF borderStyle=solid borderAlpha=0 
styleName=mystyle1


This is my tale of frustration. I've tried every which way but loose 
within the AS3/Flex docs to embed fonts. Once I set the style of the 
control or container to style1 it justs defaults to BL***Dy Times Roman. 
Please save a man from going mad


[a /]
___
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] help with a menu in xml : solved

2007-05-23 Thread Gustavo Duenas

Thanks man, it works...


Regards

Gustavo Duenas
On May 22, 2007, at 5:32 PM, Jesse Graupmann wrote:

Your problem might be that your buttons are sharing the same scope  
when

attempting to access individual variables. When you do something like:
_root.screenTxt.myText_txt1.text=menuTitle+:+textMenu; each  
button points

to the last variable you created in the loop.

By attaching the data to the button, you can access individual  
information

using 'this' inside the function.

I haven't tested this, but it looks better to me...


menus = new XML();
menus.ignoreWhite = true;
menus.onLoad = function(success)
{

var target = _root.screenTxt.myText_txt1;
var holder = _root.menu;

var titleMenus = this.firstChild.childNodes.length;
var menuContent = this.firstChild;

for (var i = 0; i  titleMenus; ++i )
{

var depth = holder.getNextHighestDepth();
var btn = holder.attachMovie( buttons, 'btn_' + i , depth
);

btn._x = 0;
btn._y = -10 * i * 4;

btn.data = {
text: menuContent.childNodes[i].attributes.text,
title: menuContent.childNodes[i].attributes.title
};


btn.poa.text = btn.data.text;
btn.onRelease = function(){
target.text = this.data.title + : +
this.data.text;
}

}

}

menus.load(txt/poa.xml);



_

Jesse Graupmann
www.jessegraupmann.com
www.justgooddesign.com/blog/
_




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of  
Gustavo

Duenas
Sent: Tuesday, May 22, 2007 1:20 PM
To: Flashcoders mailing list
Subject: [Flashcoders] help with a menu in xml

Hi coders, this is thread is the second part of the other.

well I have the buttons created and I have this onRelease behavior
attached to a every single button,
but when I tried to read into a text field part of the xml(text) this
one only reads one, not the others and when I traced them , they are
there(in the output window) but not into the field as they are
supposed to.

This is my code in as2 again:

stop();




menus = new XML();
menus.ignoreWhite = true;
menus.onLoad = function(success) {
//portfolioTag = this.firstChild;
titleMenus = this.firstChild.childNodes.length;
menuContent = this.firstChild;



for (var i = 0; i  4; i++){
// either menu or item
menuContent.childNodes[i].nodeName;
// name of the item
menuTitle= menuContent.childNodes[i].attributes.title;
var buttonsMenu= _root.menu.attachMovie(buttons, menuTitle, 10+i);
buttonsMenu._x=0;
buttonsMenu._y=-10*i*4;
var newText = buttonsMenu.poa.text=menuTitle;
// action of the item


textMenu= menuContent.childNodes[i].attributes.text;
trace(textMenu);
buttonsMenu.onRelease = function(){
_root.screenTxt.myText_txt1.text=menuTitle+:+textMenu; // loads
good but only one, the rest appears not to be there:(
};

}


}

menus.load(txt/poa.xml);



and this is xml

?xml version=1.0 encoding=ISO-8859-1?

POA

article title = Results of POA
text=The proper application of POA (Perception Oriented Advertising)
produces a change in the entire perception, a strengthening of the
capacity to remember a given brand and a clear and firm repositioning.
The result: A visible growth of your products and/or services within
the market/

article title= How do we apply POA text= Complete knowledge of
your brand
Full analysis
Identify the brand's strengths and weaknesses
Value Added Recognition
Competition follow up (what are they advertising, communication
strategy analysis)
Brand character definition
Acknowledgement and study of target groups to be reached
Clear and effective communication and marketing strategy definition
Development of different steps to follow based on the market and
target market to be captured
Communications concept definition
Final marketing campaign idea
/

article title= Previous Steps to POA text=Accept the fact that
you're not a graphic designer, programmer or have a marketing major
Acknowledge the reality that advertising, design and marketing are
not an option but a need for the expansion of your company
Recognize that the money you will pay to help your brand grow is an
investment and not an expense
Again,  bear in mind that the money you will pay to help your brand
grow is an investment and not an expense
Believe in an experienced professional staff to handle your brand.
Your business is what's at stake
Consider that there are not small businesses; even a 'home office'
may be seen as a great corporation. Perceptions!
Keep in mind that -my customers don't buy my brand but what they
perceive of it-.
If you're willing to follow the seven previous steps, you're ready to
make POA a real part of your brand
/

article title

[Flashcoders] help about buttons from xml file.

2007-05-22 Thread Gustavo Duenas
 Hi, I'm creating buttons dinamycally using a xml file, this is my  
code:




stop();




menus = new XML();
menus.ignoreWhite = true;
menus.onLoad = function(success) {
//portfolioTag = this.firstChild;
titleMenus = this.firstChild.childNodes.length;
menuContent = this.firstChild;



for (var i = 0; i  4; i++){
// either menu or item
menuContent.childNodes[i].nodeName;
// name of the item
menuTitle= menuContent.childNodes[i].attributes.title;
var buttonsMenu= _root.menu.attachMovie(buttons, menuTitle,  
this.getNextHighestDepth());

this.buttonsMenu._x=0;
this.buttonsMenu._y=-10*i;
var newText = buttonsMenu.poa.text=menuTitle;
// action of the item
textMenu= menuContent.childNodes[i].attributes.text;
trace(buttonsMenu);
// variables for that action
}


}

menus.load(txt/poa.xml);


the problem here is that it shows only one button, what about the  
rest of them, the output window shows all, but in the swf only appear  
one.

I don't know what is going on...I need Help.

When I trace the different variables, everything seems ok.

this is the xml code:

?xml version=1.0 encoding=ISO-8859-1?

POA
article title= What is POA
text =The market has been evolving in the past few years, therefore  
the communication tools cannot be the same. Along with the market,  
the consumer has also changed.
Thanks to our innovated communication method called POA (perception  
Oriented Advertising) we can reach your potential customers in a  
clear, direct and different way. This communication method is based  
on an important research conducted in the United States where it was  
concluded that customers don't buy products or services; they buy  
perceptions. For example, women don't buy make-up, they buy beauty.  
Men don't buy gym services, they buy a perfect body. Executives don't  
buy luxury vehicles, they buy status. Observe the difference between  
what I buy- and -how I feel when I buy it-.
This is what our effective communication tool is all about: reality  
vs. perception. The way in which you communicate your products or  
services is the perception your potential customers will have of you.  
So please be particularly careful with the way you advertise your  
products or services.

/

article title= Previous Steps to POA text=Accept the fact that  
you're not a graphic designer, programmer or have a marketing major
Acknowledge the reality that advertising, design and marketing are  
not an option but a need for the expansion of your company
Recognize that the money you will pay to help your brand grow is an  
investment and not an expense
Again,  bear in mind that the money you will pay to help your brand  
grow is an investment and not an expense
Believe in an experienced professional staff to handle your brand.  
Your business is what's at stake
Consider that there are not small businesses; even a 'home office'  
may be seen as a great corporation. Perceptions!
Keep in mind that -my customers don't buy my brand but what they  
perceive of it-.
If you're willing to follow the seven previous steps, you're ready to  
make POA a real part of your brand

/

article title= How do we apply POA text= Complete knowledge of  
your brand

Full analysis
Identify the brand's strengths and weaknesses
Value Added Recognition
Competition follow up (what are they advertising, communication  
strategy analysis)

Brand character definition
Acknowledgement and study of target groups to be reached
Clear and effective communication and marketing strategy definition
Development of different steps to follow based on the market and  
target market to be captured

Communications concept definition
Final marketing campaign idea
/

article title = Results of POA
text=The proper application of POA (Perception Oriented Advertising)  
produces a change in the entire perception, a strengthening of the  
capacity to remember a given brand and a clear and firm repositioning.
The result: A visible growth of your products and/or services within  
the market/


/POA







Gustavo Duenas
Creative Director
LEFT AND RIGHT SOLUTIONS LLC
1225 W. Beaver St. Suite 119
Jacksonville, Fl.  32204
904 . 2650330
www.leftandrightsolutions.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] help about buttons from xml file.

2007-05-22 Thread Allandt Bik-Elliott (Receptacle)
are the rest of them dissappearing off the top of the movie  
(this.buttonsMenu._y=-10*i;)? try using a positive number just to see  
if they appear



On 22 May 2007, at 19:41, Gustavo Duenas wrote:

 Hi, I'm creating buttons dinamycally using a xml file, this is my  
code:




stop();




menus = new XML();
menus.ignoreWhite = true;
menus.onLoad = function(success) {
//portfolioTag = this.firstChild;
titleMenus = this.firstChild.childNodes.length;
menuContent = this.firstChild;



for (var i = 0; i  4; i++){
// either menu or item
menuContent.childNodes[i].nodeName;
// name of the item
menuTitle= menuContent.childNodes[i].attributes.title;
var buttonsMenu= _root.menu.attachMovie(buttons, menuTitle,  
this.getNextHighestDepth());

this.buttonsMenu._x=0;
this.buttonsMenu._y=-10*i;
var newText = buttonsMenu.poa.text=menuTitle;
// action of the item
textMenu= menuContent.childNodes[i].attributes.text;
trace(buttonsMenu);
// variables for that action
}


}

menus.load(txt/poa.xml);


the problem here is that it shows only one button, what about the  
rest of them, the output window shows all, but in the swf only  
appear one.

I don't know what is going on...I need Help.

When I trace the different variables, everything seems ok.

this is the xml code:

?xml version=1.0 encoding=ISO-8859-1?

POA
article title= What is POA
text =The market has been evolving in the past few years,  
therefore the communication tools cannot be the same. Along with  
the market, the consumer has also changed.
Thanks to our innovated communication method called POA (perception  
Oriented Advertising) we can reach your potential customers in a  
clear, direct and different way. This communication method is based  
on an important research conducted in the United States where it  
was concluded that customers don't buy products or services; they  
buy perceptions. For example, women don't buy make-up, they buy  
beauty. Men don't buy gym services, they buy a perfect body.  
Executives don't buy luxury vehicles, they buy status. Observe the  
difference between what I buy- and -how I feel when I buy it-.
This is what our effective communication tool is all about: reality  
vs. perception. The way in which you communicate your products or  
services is the perception your potential customers will have of  
you. So please be particularly careful with the way you advertise  
your products or services.

/

article title= Previous Steps to POA text=Accept the fact that  
you're not a graphic designer, programmer or have a marketing major
Acknowledge the reality that advertising, design and marketing are  
not an option but a need for the expansion of your company
Recognize that the money you will pay to help your brand grow is an  
investment and not an expense
Again,  bear in mind that the money you will pay to help your brand  
grow is an investment and not an expense
Believe in an experienced professional staff to handle your brand.  
Your business is what's at stake
Consider that there are not small businesses; even a 'home office'  
may be seen as a great corporation. Perceptions!
Keep in mind that -my customers don't buy my brand but what they  
perceive of it-.
If you're willing to follow the seven previous steps, you're ready  
to make POA a real part of your brand

/

article title= How do we apply POA text= Complete knowledge of  
your brand

Full analysis
Identify the brand's strengths and weaknesses
Value Added Recognition
Competition follow up (what are they advertising, communication  
strategy analysis)

Brand character definition
Acknowledgement and study of target groups to be reached
Clear and effective communication and marketing strategy definition
Development of different steps to follow based on the market and  
target market to be captured

Communications concept definition
Final marketing campaign idea
/

article title = Results of POA
text=The proper application of POA (Perception Oriented  
Advertising) produces a change in the entire perception, a  
strengthening of the capacity to remember a given brand and a clear  
and firm repositioning.
The result: A visible growth of your products and/or services  
within the market/


/POA







Gustavo Duenas
Creative Director
LEFT AND RIGHT SOLUTIONS LLC
1225 W. Beaver St. Suite 119
Jacksonville, Fl.  32204
904 . 2650330
www.leftandrightsolutions.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@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

Re: [Flashcoders] help about buttons from xml file: solved

2007-05-22 Thread Gustavo Duenas
I've just resolved this, It was in the this.getNextHighestDepth(); .  
I use the , 10+1 instead of, and voila!!! it works

On May 22, 2007, at 2:41 PM, Gustavo Duenas wrote:

 Hi, I'm creating buttons dinamycally using a xml file, this is my  
code:




stop();




menus = new XML();
menus.ignoreWhite = true;
menus.onLoad = function(success) {
//portfolioTag = this.firstChild;
titleMenus = this.firstChild.childNodes.length;
menuContent = this.firstChild;



for (var i = 0; i  4; i++){
// either menu or item
menuContent.childNodes[i].nodeName;
// name of the item
menuTitle= menuContent.childNodes[i].attributes.title;
var buttonsMenu= _root.menu.attachMovie(buttons, menuTitle,  
this.getNextHighestDepth());

this.buttonsMenu._x=0;
this.buttonsMenu._y=-10*i;
var newText = buttonsMenu.poa.text=menuTitle;
// action of the item
textMenu= menuContent.childNodes[i].attributes.text;
trace(buttonsMenu);
// variables for that action
}


}

menus.load(txt/poa.xml);


the problem here is that it shows only one button, what about the  
rest of them, the output window shows all, but in the swf only  
appear one.

I don't know what is going on...I need Help.

When I trace the different variables, everything seems ok.

this is the xml code:

?xml version=1.0 encoding=ISO-8859-1?

POA
article title= What is POA
text =The market has been evolving in the past few years,  
therefore the communication tools cannot be the same. Along with  
the market, the consumer has also changed.
Thanks to our innovated communication method called POA (perception  
Oriented Advertising) we can reach your potential customers in a  
clear, direct and different way. This communication method is based  
on an important research conducted in the United States where it  
was concluded that customers don't buy products or services; they  
buy perceptions. For example, women don't buy make-up, they buy  
beauty. Men don't buy gym services, they buy a perfect body.  
Executives don't buy luxury vehicles, they buy status. Observe the  
difference between what I buy- and -how I feel when I buy it-.
This is what our effective communication tool is all about: reality  
vs. perception. The way in which you communicate your products or  
services is the perception your potential customers will have of  
you. So please be particularly careful with the way you advertise  
your products or services.

/

article title= Previous Steps to POA text=Accept the fact that  
you're not a graphic designer, programmer or have a marketing major
Acknowledge the reality that advertising, design and marketing are  
not an option but a need for the expansion of your company
Recognize that the money you will pay to help your brand grow is an  
investment and not an expense
Again,  bear in mind that the money you will pay to help your brand  
grow is an investment and not an expense
Believe in an experienced professional staff to handle your brand.  
Your business is what's at stake
Consider that there are not small businesses; even a 'home office'  
may be seen as a great corporation. Perceptions!
Keep in mind that -my customers don't buy my brand but what they  
perceive of it-.
If you're willing to follow the seven previous steps, you're ready  
to make POA a real part of your brand

/

article title= How do we apply POA text= Complete knowledge of  
your brand

Full analysis
Identify the brand's strengths and weaknesses
Value Added Recognition
Competition follow up (what are they advertising, communication  
strategy analysis)

Brand character definition
Acknowledgement and study of target groups to be reached
Clear and effective communication and marketing strategy definition
Development of different steps to follow based on the market and  
target market to be captured

Communications concept definition
Final marketing campaign idea
/

article title = Results of POA
text=The proper application of POA (Perception Oriented  
Advertising) produces a change in the entire perception, a  
strengthening of the capacity to remember a given brand and a clear  
and firm repositioning.
The result: A visible growth of your products and/or services  
within the market/


/POA







Gustavo Duenas
Creative Director
LEFT AND RIGHT SOLUTIONS LLC
1225 W. Beaver St. Suite 119
Jacksonville, Fl.  32204
904 . 2650330
www.leftandrightsolutions.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



Gustavo Duenas
Creative Director
LEFT AND RIGHT SOLUTIONS LLC
1225 W. Beaver St. Suite 119
Jacksonville, Fl.  32204
904 . 2650330
www.leftandrightsolutions.com


___
Flashcoders@chattyfig.figleaf.com
To change your 

[Flashcoders] help with a menu in xml

2007-05-22 Thread Gustavo Duenas

Hi coders, this is thread is the second part of the other.

well I have the buttons created and I have this onRelease behavior  
attached to a every single button,
but when I tried to read into a text field part of the xml(text) this  
one only reads one, not the others and when I traced them , they are  
there(in the output window) but not into the field as they are  
supposed to.


This is my code in as2 again:

stop();




menus = new XML();
menus.ignoreWhite = true;
menus.onLoad = function(success) {
//portfolioTag = this.firstChild;
titleMenus = this.firstChild.childNodes.length;
menuContent = this.firstChild;



for (var i = 0; i  4; i++){
// either menu or item
menuContent.childNodes[i].nodeName;
// name of the item
menuTitle= menuContent.childNodes[i].attributes.title;
var buttonsMenu= _root.menu.attachMovie(buttons, menuTitle, 10+i);
buttonsMenu._x=0;
buttonsMenu._y=-10*i*4;
var newText = buttonsMenu.poa.text=menuTitle;
// action of the item


textMenu= menuContent.childNodes[i].attributes.text;
trace(textMenu);
buttonsMenu.onRelease = function(){
_root.screenTxt.myText_txt1.text=menuTitle+:+textMenu; // loads  
good but only one, the rest appears not to be there:(

};

}


}

menus.load(txt/poa.xml);



and this is xml

?xml version=1.0 encoding=ISO-8859-1?

POA

article title = Results of POA
text=The proper application of POA (Perception Oriented Advertising)  
produces a change in the entire perception, a strengthening of the  
capacity to remember a given brand and a clear and firm repositioning.
The result: A visible growth of your products and/or services within  
the market/


article title= How do we apply POA text= Complete knowledge of  
your brand

Full analysis
Identify the brand's strengths and weaknesses
Value Added Recognition
Competition follow up (what are they advertising, communication  
strategy analysis)

Brand character definition
Acknowledgement and study of target groups to be reached
Clear and effective communication and marketing strategy definition
Development of different steps to follow based on the market and  
target market to be captured

Communications concept definition
Final marketing campaign idea
/

article title= Previous Steps to POA text=Accept the fact that  
you're not a graphic designer, programmer or have a marketing major
Acknowledge the reality that advertising, design and marketing are  
not an option but a need for the expansion of your company
Recognize that the money you will pay to help your brand grow is an  
investment and not an expense
Again,  bear in mind that the money you will pay to help your brand  
grow is an investment and not an expense
Believe in an experienced professional staff to handle your brand.  
Your business is what's at stake
Consider that there are not small businesses; even a 'home office'  
may be seen as a great corporation. Perceptions!
Keep in mind that -my customers don't buy my brand but what they  
perceive of it-.
If you're willing to follow the seven previous steps, you're ready to  
make POA a real part of your brand

/

article title= What is POA
text =The market has been evolving in the past few years, therefore  
the communication tools cannot be the same. Along with the market,  
the consumer has also changed.
Thanks to our innovated communication method called POA (perception  
Oriented Advertising) we can reach your potential customers in a  
clear, direct and different way. This communication method is based  
on an important research conducted in the United States where it was  
concluded that customers don't buy products or services; they buy  
perceptions. For example, women don't buy make-up, they buy beauty.  
Men don't buy gym services, they buy a perfect body. Executives don't  
buy luxury vehicles, they buy status. Observe the difference between  
what I buy- and -how I feel when I buy it-.
This is what our effective communication tool is all about: reality  
vs. perception. The way in which you communicate your products or  
services is the perception your potential customers will have of you.  
So please be particularly careful with the way you advertise your  
products or services.

/
/POA


Gustavo Duenas
Creative Director
LEFT AND RIGHT SOLUTIONS LLC
1225 W. Beaver St. Suite 119
Jacksonville, Fl.  32204
904 . 2650330
www.leftandrightsolutions.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] help with a menu in xml

2007-05-22 Thread Jesse Graupmann
Your problem might be that your buttons are sharing the same scope when
attempting to access individual variables. When you do something like:
_root.screenTxt.myText_txt1.text=menuTitle+:+textMenu; each button points
to the last variable you created in the loop.

By attaching the data to the button, you can access individual information
using 'this' inside the function.

I haven't tested this, but it looks better to me...


menus = new XML();
menus.ignoreWhite = true;
menus.onLoad = function(success)
{

var target = _root.screenTxt.myText_txt1;
var holder = _root.menu;

var titleMenus = this.firstChild.childNodes.length;
var menuContent = this.firstChild;

for (var i = 0; i  titleMenus; ++i )
{

var depth = holder.getNextHighestDepth();
var btn = holder.attachMovie( buttons, 'btn_' + i , depth
); 

btn._x = 0; 
btn._y = -10 * i * 4; 

btn.data = { 
text: menuContent.childNodes[i].attributes.text,
title: menuContent.childNodes[i].attributes.title 
};


btn.poa.text = btn.data.text;
btn.onRelease = function(){
target.text = this.data.title + : +
this.data.text;
}

}

}

menus.load(txt/poa.xml);



_

Jesse Graupmann
www.jessegraupmann.com 
www.justgooddesign.com/blog/ 
_




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Gustavo
Duenas
Sent: Tuesday, May 22, 2007 1:20 PM
To: Flashcoders mailing list
Subject: [Flashcoders] help with a menu in xml 

Hi coders, this is thread is the second part of the other.

well I have the buttons created and I have this onRelease behavior  
attached to a every single button,
but when I tried to read into a text field part of the xml(text) this  
one only reads one, not the others and when I traced them , they are  
there(in the output window) but not into the field as they are  
supposed to.

This is my code in as2 again:

stop();




menus = new XML();
menus.ignoreWhite = true;
menus.onLoad = function(success) {
//portfolioTag = this.firstChild;
titleMenus = this.firstChild.childNodes.length;
menuContent = this.firstChild;



for (var i = 0; i  4; i++){
// either menu or item
menuContent.childNodes[i].nodeName;
// name of the item
menuTitle= menuContent.childNodes[i].attributes.title;
var buttonsMenu= _root.menu.attachMovie(buttons, menuTitle, 10+i);
buttonsMenu._x=0;
buttonsMenu._y=-10*i*4;
var newText = buttonsMenu.poa.text=menuTitle;
// action of the item


textMenu= menuContent.childNodes[i].attributes.text;
trace(textMenu);
buttonsMenu.onRelease = function(){
_root.screenTxt.myText_txt1.text=menuTitle+:+textMenu; // loads  
good but only one, the rest appears not to be there:(
};

}


}

menus.load(txt/poa.xml);



and this is xml

?xml version=1.0 encoding=ISO-8859-1?

POA

article title = Results of POA
text=The proper application of POA (Perception Oriented Advertising)  
produces a change in the entire perception, a strengthening of the  
capacity to remember a given brand and a clear and firm repositioning.
The result: A visible growth of your products and/or services within  
the market/

article title= How do we apply POA text= Complete knowledge of  
your brand
Full analysis
Identify the brand's strengths and weaknesses
Value Added Recognition
Competition follow up (what are they advertising, communication  
strategy analysis)
Brand character definition
Acknowledgement and study of target groups to be reached
Clear and effective communication and marketing strategy definition
Development of different steps to follow based on the market and  
target market to be captured
Communications concept definition
Final marketing campaign idea
/

article title= Previous Steps to POA text=Accept the fact that  
you're not a graphic designer, programmer or have a marketing major
Acknowledge the reality that advertising, design and marketing are  
not an option but a need for the expansion of your company
Recognize that the money you will pay to help your brand grow is an  
investment and not an expense
Again,  bear in mind that the money you will pay to help your brand  
grow is an investment and not an expense
Believe in an experienced professional staff to handle your brand.  
Your business is what's at stake
Consider that there are not small businesses; even a 'home office'  
may be seen as a great corporation. Perceptions!
Keep in mind that -my customers don't buy my brand but what they  
perceive of it-.
If you're willing to follow the seven previous steps, you're ready to  
make POA a real part of your brand
/

article title= What is POA
text =The market has been evolving in the past few years

[Flashcoders] help needed : CCForFlash and simple netstream

2007-05-16 Thread cedric newsletter

hi all,

has anyone ever tried to use the free Captioning Component CCForFlash (
http://ncam.wgbh.org/webaccess/ccforflash/).

is there an simple example with CCForFlash used with a simple video object ?
i can't make it work ! :-(

any help will be greatly appreciated
:)
have a good day !

cédric houvenagel
www.incandescence.com


-
here's my code
-
/*
videoContainer = instance name of the video object
caption_cp  = instance name of the CCforFlash component
*/

stop();

var ADRESSE_SERVEUR_VIDEO:String = null;
var FICHIER_VIDEO_DEMO:String = http://www.jeparlejaponais.com/media/demo.flv
;
var BUFFER_TIME:Number = 3;

Stage.scaleMode = noScale;
Stage.align = TL;

/

// create basic netConnection object
var nc:NetConnection = new NetConnection();
nc.connect(ADRESSE_SERVEUR_VIDEO);

// create the netStream object and pass the netConnection object in the
constructor
var ns:NetStream = new NetStream(nc);

// attach the netStream object to the video object
videoContainer.attachVideo(ns);
ns.setBufferTime(BUFFER_TIME);
ns.play(FICHIER_VIDEO_DEMO);

trace(caption_cp);
trace(caption_cp.getLanguages());
caption_cp.startCaptions(false, car.dfxp.xml, en);
___
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] help

2007-05-02 Thread syam s


how can we print a variable value in our execution screen..?
   
-
 Yahoo! Answers - Got a question? Someone out there knows the answer. Tryit now.
___
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] help

2007-05-02 Thread Danny Kodicek
  
 how can we print a variable value in our execution screen..?

'execution screen'? Do you just mean displaying a variable on screen? Try

var tField:TextField = _root.createTextField(out,
_root.getNextHighestDepth(), 100, 100, 200, 20)
tField.text = String(myVariable)

Danny

___
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


  1   2   3   4   >