Re: [Flashcoders] [AS2] Catching clicks in child clip?

2008-12-03 Thread Muzak

Use the (very) old invisible button trick.
So create a "Button symbol" with only the "hit" state (keyframe) defined and put that on top of the movieclip that holds the loaded 
swf.


- Original Message - 
From: "mike cann" <[EMAIL PROTECTED]>

To: "Flash Coders List" 
Sent: Wednesday, December 03, 2008 3:07 PM
Subject: [Flashcoders] [AS2] Catching clicks in child clip?



Hello List,

I have been forced to go back to AS2 recently for a work project and oh my
is it annoying me.

Part of the project I am writing a simple advertising loader, its basically
just a swf that loads other swfs into it.

The problem is that the adverts that are loaded in sometimes contain clicks
within them so without access to the source code i need a method of
preventing those clicks from happening.

To my knowledge this should be doable by implementing a cover over the top
of the loaded swf with a onPress, onRelease etc functions defined correct?

Well for some reason this isnt happenining.

See the source output below. You can download the project here:
http://www.mikecann.co.uk/DumpingGround/AS2_StrippedBare.zip




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


Re: [Flashcoders] [AS2] Catching clicks in child clip?

2008-12-03 Thread Muzak

Yeah, the invisible buton trick won't do in this case (only just now looked at 
the zip file).
Looks like the loaded swf listens for Mouse Events.

An overlaying invisible button will only work to prevent underlying buttons 
from working.

I'm not sure if there's a way to 'hijack' those mouse events from the loaded 
swf.
Well, at least I can't think of one right one..

regards,
Muzak

- Original Message - 
From: "mike cann" <[EMAIL PROTECTED]>

To: "Flash Coders List" 
Sent: Wednesday, December 03, 2008 6:28 PM
Subject: Re: [Flashcoders] [AS2] Catching clicks in child clip?



Hi Muzak,

I have just tried this and still get the error.

Screenshot of error:
http://www.mikecann.co.uk/DumpingGround/AS2_Problem01.png

Example Code:
http://www.mikecann.co.uk/DumpingGround/AS2_StrippedBare_SneakyButton.zip

Also there is another problem. If you click outside of the masked area of
the advert it still registers it as a click on the loaded movie!?!

Anyone else any ideas?



2008/12/3 Muzak <[EMAIL PROTECTED]>


Use the (very) old invisible button trick.
So create a "Button symbol" with only the "hit" state (keyframe) defined
and put that on top of the movieclip that holds the loaded swf.



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


Re: [Flashcoders] Registration Point of Clips (Scale 9)

2008-12-07 Thread Muzak

top left.. always.
If you need the center, calculate it.

- Original Message - 
From: "SJF" <[EMAIL PROTECTED]>

To: 
Sent: Sunday, December 07, 2008 9:22 AM
Subject: [Flashcoders] Registration Point of Clips (Scale 9)



Anyone have a preference for the registration point of clips created in
flash that are accessed dynamically?

Do you prefer Top-Left or Center alignment for your MovieClips that
are Scale-9 enabled and accessed programmatically.

Also, what about Text Fields within these Clips.

Anyone have an opinion on this.

ChHeers,
SF.


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


Re: [Flashcoders] use get / set functions or make your own

2008-12-09 Thread Muzak

+1 :-)

Use public methods when it's a method, public properties when it's a property.
Simple as that..

explicit should only be used for internal things to work, usually called by an 
implicit setter:

private var _data:Object;

private function setData():void {
   // do stuff with _data
}

public function set data(value:Object):void {
   _data = value;
   setData();
}

And a *big* +1 for this:

That being said, I don't abide by the retarded rule that you shouldn't have 
public vars in a class.  


regards,
Muzak

- Original Message - 
From: "Steven Sacks" <[EMAIL PROTECTED]>

To: "Flash Coders List" 
Sent: Wednesday, December 10, 2008 5:01 AM
Subject: Re: [Flashcoders] use get / set functions or make your own



For clarity, they're referred to as implicit and explicit.

get prop / set prop = implicit
getProp() / setProp = explicit

In AS2, it made a difference because implicits were available right away, 
whereas explicits were not available for 1 frame.  This limitation is not 
present in AS3.


Basically, implicit implies properties of a class, whereas explicit implies 
methods of a class.


I opt for implicit over explicit because this:

foo.prop = value;

makes more sense than

foo.setProp(value);

I leave methods for methods, not properties.

That being said, I don't abide by the retarded rule that you shouldn't have 
public vars in a class.  People who do this


private var _foo:Boolean;
public function get foo():Boolean { return _foo; }
public function set foo(value:Boolean):void { _foo = value; }

are masturbating and I'm not impressed by their bloated ego...I mean code. ;)

Unless something needs to happen immediately within the class when you set or 
get a prop (i.e. a state change), it's fine for it to be a public var.  It's 
faster, it's less bloat and most of us aren't writing large applications with a 
bunch of other developers.  Some of these rules were created for when good 
coders are forced to work with bad coders and the good ones need to protect 
their code from the bad ones.  When it's just you and a couple other devs, and 
you're all competent, you don't need all these checks and balances that are 
nothing more than compensation for people who you wish you didn't have to code 
with.  /rant   ;)





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


Re: [Flashcoders] video seek ability

2008-12-10 Thread Muzak
If I'm not mistaken, there's a flaw in the logic, as the progress is based on bytesLoaded and bytesTotal, while the shuttle/scrubber 
is time based.

Only the beginning and end of both will match up (0% loaded = 0 time -- 100% 
loaded = total time).

Make sense?

Most video players out there do it that way though (as you described).

regards,
Muzak

- Original Message - 
From: "Steven Sacks" <[EMAIL PROTECTED]>

To: "Flash Coders List" 
Sent: Wednesday, December 10, 2008 6:20 AM
Subject: Re: [Flashcoders] video seek ability



Here's what you need to know to make a good scrubber for progressive download 
FLVs.

1. You need a background that shows the entire width of the bar.

2. You need a progress bar that shows how much of the video has loaded.  The width of this bar is the background.width * 
(ns.bytesLoaded / ns.bytesTotal);


3. You need a playback bar or shuttle which is updated on a timer. The width (bar) or position (shuttle) is the background.width * 
(ns.time / ns.metaData.duration).


4. You put the mouse events on the progress bar.  On press, you set a flag that you're seeking (so the update doesn't move the 
bar/shuttle but does keep the progress bar updated), you pause the video, and you start a timer that calls an update function.  In 
the update function, you track the mouseX and constrain the value  (via Math.min and Math.max) to values between 0 and the 
progress bar width, to which you set the position of the shuttle or width of the playback bar.  You take the position/width of the 
bar, divide it by the background.width, multiply that by the duration of the ns, round it, and that's your seek time. When you 
release, you unpause the video (assuming the video was playing when you pressed, you'll need to keep a separate flag for that).



If you do it like I've described, then the dragging is always constrained by the current loaded amount, not the loaded amount at 
the time you pressed, and you don't get that ugly stutter when you stay in one place (there's no reason to not pause the video 
when scrubbing).


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


Re: [Flashcoders] What heck is up with "parent" in actionscript 3?

2008-12-10 Thread Muzak

Latest and greatest? AS3 has been around since 2006.

Whatever planet you've been on, welcome back to earth.. :-)

- Original Message - 
From: "strk" <[EMAIL PROTECTED]>

To: "Flash Coders List" 
Sent: Wednesday, December 10, 2008 11:00 PM
Subject: Re: [Flashcoders] What heck is up with "parent" in actionscript 3?



On Wed, Dec 10, 2008 at 01:49:02PM -0800, Carl Welch wrote:

Am I missing something? I'm finding that everything I took for granted  
in AS2 is now convoluted in AS3... I'm so frustrated.


Don't use it !
Running after latest and greatest thing isn't necessarely
a good thing. Beside, no free flash player supports AS3
at the moment, so your choice will affect freedom of people
to use the content you make available.

--strk;


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


Re: [Flashcoders] What heck is up with "parent" in actionscript 3?

2008-12-10 Thread Muzak

First you should probably ask yourself why you're using "parent", let alone 
"parent.parent".

Try tracing both parent and parent.parent, see if what comes up is what you're 
after.

regards,
Muzak

- Original Message - 
From: "Carl Welch" <[EMAIL PROTECTED]>

To: "Flash Coders List" 
Sent: Wednesday, December 10, 2008 10:49 PM
Subject: [Flashcoders] What heck is up with "parent" in actionscript 3?



Hi again,

I am trying to call a function to a parent of a movieclip. I've tried  
these two items that I found but to no avail:


(this.parent.parent as MovieClip).callMedia(String("audio"));

AND:

MovieClip(parent.parent).callMedia(String("audio"));


Am I missing something? I'm finding that everything I took for granted  
in AS2 is now convoluted in AS3... I'm so frustrated.



--


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


Re: [Flashcoders] Re: LoaderInfo extremely annoying bug!!

2008-12-15 Thread Muzak

Tried using Event.COMPLETE instead of Event.INIT?

regards,
Muzak

- Original Message - 
From: "Taka Kojima" 

To: 
Sent: Monday, December 15, 2008 12:51 PM
Subject: [Flashcoders] Re: LoaderInfo extremely annoying bug!!



Whoops... sorry, pasted old code, you might have been wondering what was up
with that ENTER_FRAME...

   private function loadImage(imageID:String):void{

var gallery:XML = XML(_xml.gallery.(@id == currentGallery));
var image:XML = XML(gallery.image.(@imageID == imageID));

if(ima...@bordersize == undefined){ima...@bordersize = "0";}

Gallery.getInstance().imageInfo._title.text = ima...@title;
Gallery.getInstance().imageInfo._description.text =
ima...@description;

imageLoader = new Loader();
imageLoader.contentLoaderInfo.addEventListener(Event.INIT,
onImageLoad);

imageLoader.load(new URLRequest(galle...@folder + "/" +
ima...@src));

function onImageLoad(e:Event):void{

//imageLoader.x = -(imageLoader.width/2);
//imageLoader.y = -(imageLoader.height/2);

mainImage.border.width = imageLoader.width;
mainImage.border.height = imageLoader.height;

var borderWidth:Number = imageLoader.width +
(Number(ima...@bordersize)*2);
var borderHeight:Number = imageLoader.height +
(Number(ima...@bordersize)*2);

//mainImage.border.width = borderWidth;
//mainImage.border.height = borderHeight;
//mainImage.border.x = -(borderWidth/2);
//mainImage.border.y = -(borderHeight/2);

var tweenX:Tween = new Tween(mainImage.border, "x",
Regular.easeOut, mainImage.border.x, -(borderWidth/2), 1, true);
var tweenY:Tween = new Tween(mainImage.border, "y",
Regular.easeOut, mainImage.border.y, -(borderHeight/2), 1, true);
var tweenWidth:Tween = new Tween(mainImage.border, "width",
Regular.easeOut, mainImage.border.width, borderWidth, 1, true);
var tweenHeight:Tween = new Tween(mainImage.border,
"height", Regular.easeOut, mainImage.border.height, borderHeight, 1, true);

//TweenLite.to(mainImage.border, 1, {x:-(borderWidth/2),
y:-(borderHeight/2), width: borderWidth, height: borderHeight,
ease:Circ.easeIn});
//mainImage.addChild(imageLoader);
}

currentImage = imageID;

}



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


Re: [Flashcoders] referencing sprites within a sprite (AS3newbiequestion)

2008-12-17 Thread Muzak

I think your *bigger* problem is the fact that you're actually doing something 
like;

this.that.these.those 


You should never have to do that, not even in AS2.
"that' should expose properties and methods to get things done.

regards,
Muzak

- Original Message - 
From: "Mendelsohn, Michael" 

To: "Flash Coders List" 
Sent: Wednesday, December 17, 2008 2:51 PM
Subject: RE: [Flashcoders] referencing sprites within a sprite 
(AS3newbiequestion)



Hi everyone...

Building an array using the references was the right answer.  I really
appreciate all of your replies.

Migrating from AS2 where I could easily reference via
this.that.these.those to DisplayObject references will take a bit of
getting used to I suppose.

Big thanks!
- Michael M.



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


Re: [Flashcoders] Custom eventListener

2008-12-18 Thread Muzak

You might wanna read the docs for some basics on Events in AS3:
http://livedocs.adobe.com/flash/9.0/main/0138.html
http://livedocs.adobe.com/flash/9.0/main/0139.html

When writing cusom events, you can usually ommit the bubbles and cancellable 
arguments, as those are false by default.

And you should always implement a clone() method:


Event class utility methods

There are two utility methods in the Event class. The clone() method allows you to create copies of an event object. The toString() 
method allows you to generate a string representation of the properties of an event object along with their values. Both of these 
methods are used internally by the event model system, but are exposed to developers for general use.


For advanced developers creating subclasses of the Event class, you must override and implement versions of both utility methods to 
ensure that the event subclass will work properly.



AFAIK, the toString() method is only useful for debugging purposes (trace).

- Original Message - 
From: "Cor" 

To: "'Flash Coders List'" 
Sent: Thursday, December 18, 2008 11:27 PM
Subject: RE: [Flashcoders] Custom eventListener



Thanks Ross and Jason!

Now I understand this.
But I am trying to imagine when I would use a custom event.
I have no idea?
Could you give an example?

Kind regards
Cor

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill,
Jason
Sent: donderdag 18 december 2008 23:20
To: Flash Coders List
Subject: RE: [Flashcoders] Custom eventListener

To add on to David's fine reply, Ross, you're close, but not quite - this is
how I write custom events, I think you'll want to do something like this
instead - this works great for me:

To write the event:

package events
{
import flash.events.Event;

public class MyEvent extends Event
{
public static var MYEVENT1:String = "myEvent1";
public static var MYEVENT2:String = "myEvent2";

public function MyEvent(type:String, bubbles:Boolean =
false, cancellable:Boolean = false )
{
super(type, bubbles, cancelable);
}

}

}

Then to dispatch:

import events.MyEvent;

dispatchEvent(new MyEvent(MyEvent.MYEVENT2, false, true));


Then to listen and react to dispatch:

myObject.addEventListener(MyEvent.MYEVENT2, onMyEvent2)

public function onMyEvent2(event:MyEvent):void
{
Trace("myEvent2 heard!");
}


Jason Merrill
Bank of America Instructional Technology & Media   ·   GCIB & Staff
Support L&LD



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


Re: [Flashcoders] Distributing packaged file on the Mac

2008-12-31 Thread Muzak

Why not go with AIR?

- Original Message - 
From: "Paul Steven" 

To: "'Flash Coders List'" 
Sent: Wednesday, December 31, 2008 11:40 AM
Subject: [Flashcoders] Distributing packaged file on the Mac



I have created a game using Flash CS3 and would like to distribute it for
the PC and Mac. For the PC, I am using the free "Inno" installer to create
an installer. However for the Mac, I am not having much joy finding a
suitable installer application. Can anyone recommend a Mac installer? This
is a one off job so I don't want to spend too much on the Mac installer
software. The game is a single file with all assets embedded so I am not
looking for anything too complex.

I guess the alternative is just to zip the file and distribute it as a zip
but my client is keen to have an installer to make it really simple for
users.

Thanks and a happy new year to everyone!!

Paul



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


Re: [Flashcoders] Distributing packaged file on the Mac

2008-12-31 Thread Muzak

An AIR installer works on all supported platforms, that's the beauty of it.

http://www.adobe.com/products/air/
http://www.adobe.com/products/air/business/

http://www.adobe.com/go/marketplace

Here's an app of mine:
It's meant for AIR developers.. creates png icons for AIR applications from a 
single png file.
http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&loc=en_us&extid=1700072

Demo here:
http://muzakdeezign.com/air/icon_generator/demo/

regards,
Muzak

- Original Message - 
From: "Paul Steven" 

To: "'Flash Coders List'" 
Sent: Wednesday, December 31, 2008 1:40 PM
Subject: RE: [Flashcoders] Distributing packaged file on the Mac



Air? I didn't realise you could make a Mac installer with Air!!! Can you?

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Muzak
Sent: 31 December 2008 11:53
To: Flash Coders List
Subject: Re: [Flashcoders] Distributing packaged file on the Mac

Why not go with AIR?



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


Re: [Flashcoders] Making a CS3 SWC code library look "pretty"

2009-01-02 Thread Muzak

Have a look at the fl.livepreview package:

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/fl/livepreview/package-detail.html
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/fl/livepreview/LivePreviewParent.html


- Original Message - 
From: "Samuel Adu" 

To: 
Sent: Friday, January 02, 2009 1:01 PM
Subject: [Flashcoders] Making a CS3 SWC code library look "pretty"



Hey guys - Quick one here.
So I've created a swc code library which I will distribute in an MXP
(targeted for CS3/CS4 users only for now). With all other "normal" SWC
components, you can add a custom Icon easily + a live preview. It seems that
you cannot do these things easily when it comes to creating a code library.

The icon issue is not so difficult to get around - You simply un-archive the
SWC, add the icon png and edit catalog.xml then re-zip it all up. My problem
is that when a user drags the library from the components panel onto the
stage they see just a bounding box. Once that loses focus, they see nothing.
I've added graphical elements to the FLA which I created that code lib SWC
from and it ends up a fraction of the size that it should be, so you can
hardly see it. I've even tried modifying catalog.xml to add a live preview
swf, and it's the same thing.

Has anybody managed to do this successfully?

Thanks in advance

Sam


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


Re: [Flashcoders] updateAll event to notify List that dp changed - gonein AS3?

2009-01-23 Thread Muzak

User a DataProvider instance instead of an Array
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/fl/data/DataProvider.html

You then change the dataprovider instance and the list will detect the changes.

import fl.data.DataProvider;
var data:DataProvider = new DataProvider([{label:"user 01"}, {label:"user 
02"}]);

function addClickHandler(evt:MouseEvent):void {
var user:Object = {label:"new user"};
data.addItem(user);
}

user_list.dataProvider = data;
add_btn.addEventListener(MouseEvent.CLICK, addClickHandler);

regards,
Muzak

- Original Message - 
From: "Alexander Farber" 

To: "Flash Coders List" 
Sent: Friday, January 23, 2009 10:11 PM
Subject: [Flashcoders] updateAll event to notify List that dp changed - gonein 
AS3?



Hello,

I'm porting a webchat-like application from AS2 to AS3
with a list of usernames displayed in a List component.

In AS2 I had to save those usernames into an Array
and then send an event "updateAll" to the List
component to let it know that its dataProvider
(an Array with webchat-usernames) has changed.

But now when reading AS3 docs I can't find such an event.

I've tried just fl.controls.List.removeAll() and then
a series of addItem() and don't notice any flickering
or problems yet. Is the updateAll-event gone in AS3?

Thank you
Alex


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


Re: [Flashcoders] Adding a property to an AS3-component

2009-01-25 Thread Muzak

Ofcourse that works, you're using plain MovieClips, which are dynamic.
This has nothing to do with the use of an Array.
The original question was how to do that with Button components, which you 
can't since they're not dynamic.

As already mentioned, extend the required class and add the property/properties 
you need.


But I thought the questioner was not in to that, so maybe a bad habit is a
better solution, then none.


Afraid I disagree.. especially when passing them on to others it becomes super 
bad.

regards,
Muzak



- Original Message - 
From: "Cor" 

To: "'Flash Coders List'" 
Sent: Sunday, January 25, 2009 3:11 PM
Subject: RE: [Flashcoders] Adding a property to an AS3-component



Here is the example:

1. create an new movieclip and put a rectangle in as background
2. on top (or higher layer) put a dynamic textfield, give it an instance
name of tf
3. give the movieclip in the library a linkage MyButton
4. paste this code in the first and only frame on the Main timeline!:

//BEGIN CODE
//create array for buttonlabels
var arrButtonsLabels:Array = ["One", "Two", "Three", "Four", "Five", "Six",
"Seven"];
var arrButtons = [];
var amount:int = arrButtonsLabels.length;

//Using one loop to do it all
for (var i=0; iis moused."; 
}


//END CODE

5. Test Movie and look at Output panel


HTH
Cor




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


Re: [Flashcoders] Loading image on local filesystem

2009-01-29 Thread Muzak

use relative path and forward slashes

"img/image.jpg"

- Original Message - 
From: "K-Dawg" 

To: "Flash Coders List" 
Sent: Thursday, January 29, 2009 1:12 AM
Subject: [Flashcoders] Loading image on local filesystem



The AS is in a dir1 (dir1\stuff.as) and the images are in
dir1\img\image.jpg.

   imagePath = new URLRequest(this.imagePathString);
   loader = new Loader();
   trace(loader.load(imagePath));

this.imagePathString is a relative path to the image (img\image.jpg).

How can I load these from a local filesystem?  This will be moved to a web
server but for testing I am running on windows and Flash CS3 in Windows XP
as a vm on my laptop in VMWare.

Thanks for any help.

Kevin
___
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] Missing Flashcoder archives?

2009-01-29 Thread Muzak

Try using the "mail-archive" site:
http://www.mail-archive.com/flashcoders@chattyfig.figleaf.com/



- Original Message - 
From: "Todd Kerpelman" 

To: "Flash Coders List" 
Sent: Thursday, January 29, 2009 5:56 PM
Subject: [Flashcoders] Missing Flashcoder archives?



Hey, List folks!

So in the interest of "Not trying to repost too many questions that have
already been asked" (like, for example, probably this one) I've been trying
to search the Flash Coders List archives. However, going to the archives
page over at figleaf.com (
http://chattyfig.figleaf.com/mailman/private/flashcoders/) brings me to a
page where nothing has been added since December 2007.

Is there a new location where our mail is being stored, or is the archive
page just not working?

--T
___


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


Re: [Flashcoders] This is kind of Wonderfl

2009-02-02 Thread Muzak
Haven't really looked into all the wonderfl details, but - at first looks - seems similar to what is already possible with Flex and 
Coldfusion.
Flex 1.0 and 1.5 were both compiled on the server, there was no swf output like there is with Flex 2 and 3 and what we're used from 
the Flash IDE.


Flex 2/3 can still be compiled server side in combination with Coldfusion.

So rather than having an html + swf, you'd browse to an mxml file.
http://domain.com/index.mxml


How comfortable are people with having all your sourcecode online instead of local 
& online storage
- would make me nervous on very large projects


Doesn't change anything development wise.
You'd still have a local copy - deploying to a local (or network) server for 
testing.
Upload to live server when done.


What happens when you want to compile and the server is down or hiccups?
Must be online to develop - no working on the airplane or places without Wi-Fi


Same as above, not an issue if you'd develop locally.
And that goes for most of your other concerns.

Just because they're demoing it online, doesn't mean you *have* to develop 
online, well at least that's the way I see it :).

regards,
Muzak


- Original Message - 
From: "Merrill, Jason" 

To: "Flash Coders List" 
Sent: Monday, February 02, 2009 11:26 PM
Subject: RE: [Flashcoders] This is kind of Wonderfl



Hmmm, yeah, but right now, I can't see past these issues (along with your 
better GUI and compiling :

Code completion and other nice features of code editors! - they would definitely need to implement that - and how would that 
handle smart import statements for your project?  Could be tricky,
How comfortable are people with having all your sourcecode online instead of local & online storage - would make me nervous on 
very large projects

Using third party code - or importing classes of your own - they would have to 
support that.
What happens when you want to compile and the server is down or hiccups?  It was doing that to me when I tested - annoying and a 
big productivity waster.

Must be online to develop - no working on the airplane or places without Wi-Fi
Working inside a browser - that's going to impose several limitations there - 
like hotkey combination conflicts
Not seeing your file structure locally - they would have to create a pretty 
slick UI for viewing your project
Working with media assets - what about having to upload images, movies, sound, 
fonts, yuck!

I think it maybe has potential a long way down the road, but so far, this isn't anything I think people will be able to do 
anything useful with just yet.  Seems the disadvantages far outweigh the advantages - at least right now. Maybe someday.



Jason Merrill
Bank of America Instructional Technology & Media   ·   Learning Performance 
Solutions L&LD

Interested in Flash Platform technologies? Join the Bank of America Flash 
Platform Community
Interested in innovative ideas in Learning? Check out the Innovative Learning 
Blog and subscribe.




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


Re: [Flashcoders] Details of extending UIComponent

2009-02-02 Thread Muzak

Flexcoders can be a bit overwhelming and posts get lost in the masses.
Try FlexComponents on yahoo instead for component related posts.
http://tech.groups.yahoo.com/group/flexcomponents/

Does this have the information you need?
http://livedocs.adobe.com/flex/3/html/help.html?content=ascomponents_advanced_1.html
http://livedocs.adobe.com/flex/3/html/ascomponents_advanced_3.html#214104

Here's a summary from the docs:
http://livedocs.adobe.com/flex/3/html/ascomponents_advanced_2.html#219779



To implement your component, follow these general steps:

  1. If necessary, create any skins for the component.
  2. Create an ActionScript class file.
1. Extend one of the base classes, such as UIComponent or another 
component class.
2. Specify properties that the user can set by using an MXML tag 
property.
3. Embed any graphic and skin files.
4. Implement the constructor.
5. Implement the UIComponent.createChildren() method.
6. Implement the UIComponent.commitProperties() method.
7. Implement the UIComponent.measure() method.
8. Implement the UIComponent.layoutChrome() method.
9. Implement the UIComponent.updateDisplayList() method.
   10. Add properties, methods, styles, events, and metadata.
  3. Deploy the component as an ActionScript file or as a SWC file.



regards,
Muzak

- Original Message - 
From: "Merrill, Jason" 

To: "Flash Coders List" 
Sent: Monday, February 02, 2009 11:31 PM
Subject: [Flashcoders] Details of extending UIComponent


I posted this on Flexcoders earlier today without any responses.  But then, Yahoo's servers have also been timing out - maybe the 
forum is not working well.  I figure someone else might be able to point me to some information.


Can someone send me some links to information on all the ins and outs
of creating visual custom Flex UIComponents with AS3 3 - NOT
MXML (i.e. a class that extends UIComponent) ?

I've actually done it before, but had some bugs and headaches because I
didn't fully understand all the intricacies of method overriding you
have to/should do - things like measure(), clone(), updateDisplayList
(), etc. - so that it looks/works right and the UIComponent stays
within its container (for example, you create a UIComponent that draws
a large circle, but you want the circle to remain within the bounds of
a scrollpane component it is a child of).

I've googled all over the place, including adobe devnet and the
Flexcoders archives and have come up short. Seems to be bits and
pieces - I'm looking for some kind of explanation or simple example of
writing a visual component

I understand the AS3 drawing API and databinding, I just want info on
the rest of best practices for extending UIComponent. Seems like I had
seen a tutorial on this before on devnet, but I can't locate it now
(the search on that thing is terrible!) - also others have made some
good posts on that here as well, but can't find those either.

Thanks!


Jason Merrill
Bank of America Instructional Technology & Media   ·   Learning Performance 
Solutions L&LD



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


Re: [Flashcoders] OT: Internet Explorer 8

2009-02-03 Thread Muzak

wrong list then..

- Original Message - 
From: "Vayu Robins" 

To: "Flash Coders List" 
Sent: Tuesday, February 03, 2009 5:44 PM
Subject: Re: [Flashcoders] OT: Internet Explorer 8



Thanks for your input Jason.

I know this is a flash forum, but the website I have created for this client
is without flash, so flash player version is not relevant in this case.


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


Re: [Flashcoders] capturing mouse events for layered sprites

2009-02-03 Thread Muzak

Check if the mouse position is within (or outside) the container bounderies in 
the rollout event and act accordingly.

Look into: 
flash.geom.Rectangle

flash.display.DisplayObject.getBounds()
flash.display.DisplayObject.getRect()

regards,
Muzak

- Original Message - 
From: "ali drongo" 

To: "Flash Coders List" 
Sent: Tuesday, February 03, 2009 4:37 PM
Subject: Re: [Flashcoders] capturing mouse events for layered sprites



Thanks for your reply Dennis. I'm afraid this won't solve my problem as I
need all of the children to be mouseEnabled so they can receive mouse events
that are processed by their custom class.
Any other suggestions much appreciated.
Thanks!




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


Re: [Flashcoders] OT: Internet Explorer 8

2009-02-03 Thread Muzak

Agree with Jason.
Requiring an app to work on beta software is unrealistic.

For all we know that person uses a 64bit version, for which there is no flash 
player at all.

regards,
Muzak

- Original Message - 
From: "Merrill, Jason" 

To: "Flash Coders List" 
Sent: Tuesday, February 03, 2009 5:31 PM
Subject: RE: [Flashcoders] OT: Internet Explorer 8



Is it fair of client to ask me test for IE8 when it isn't officially released 
yet?


No.  There are any number of bugs that could be in pre-release versions.  Plus, your contract with the client should have 
explicitly stated the browser vendor and version(s) you would build for. They can't expect you to forever be forward compatible. 
I would push back.  And as a side note, ask if the IE8 person has the right Flash player version installed.



Jason Merrill



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


Re: [Flashcoders] Best way to access my main class?

2009-02-05 Thread Muzak

Look into Event bubbling

http://www.google.com/search?hl=en&q=AS3+event+bubbling&meta=

- Original Message - 
From: "Lehr, Ross (N-SGIS)" 

To: "Flash Coders List" 
Sent: Thursday, February 05, 2009 8:14 PM
Subject: RE: [Flashcoders] Best way to access my main class?


This brings up a question I had about events.  Is there a way to send an event all the way to the document class, no matter where 
it's been dispatched from?  For instance, I have a document class that creates a "menu" class, which creates several "icon button" 
classes.  I want the document class to be able to receive the event dispatched from the "icon button".  Currently, the only way I 
know how to do it is have the "icon button" send it to the "menu" and then the "menu" send it to the document.  So, my question 
is, can the document class receive an event directly sent from the "icon button"?


Thanks,
Ross


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


Re: [Flashcoders] Starting a new thread

2009-02-06 Thread Muzak

Also make sure the thread subject is meaningful for the archives.

- Original Message - 
From: "Ricardo M. Portilho" 

To: "Flash Coders List" 
Sent: Friday, February 06, 2009 1:00 PM
Subject: [Flashcoders] Starting a new thread




- Original Message - 
From: "allandt bik-elliott (thefieldcomic.com)" 

To: "Flash Coders List" 
Sent: Thursday, February 05, 2009 2:26 PM
Subject: Re: [Flashcoders] Does Flash fire any event(s) when...


Excuse me friend and all friends,
I didn't mean to do this "hijajacked threads" was a mistake, I really sorry, 
and you are 100% right,

so I just send a new thread I hope you can help me,

my best regards
R.


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

To: "Flash Coders List" 
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


Re: [Flashcoders] Converting hex colour numbers back and forth

2009-02-10 Thread Muzak

Maybe this will help?
http://muzakdeezign.com/flex3/flex3lib/ColorUtil.zip

//docs
http://muzakdeezign.com/flex3/flex3lib/docs/com/muzakdeezign/flex/utils/ColorUtil.html

regards,
Muzak

- Original Message - 
From: "ali drongo" 

To: "Flash Coders List" 
Sent: Monday, February 09, 2009 6:26 PM
Subject: [Flashcoders] Converting hex colour numbers back and forth



Hi there, I'm saving a bunch of colours as a string then using this string
later to colour objects in the same way.  Something is going wrong though as
the colours I am getting back are not the same as the ones I put in.
If anyone could point out where I'm going wrong I'd be really grateful, I've
googled this and and have checked the help files and as far as I can see
it's correct (though obviously it isn't!).



___
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; jhttp://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Advanced Rollover Physics/Math...

2009-02-12 Thread Muzak

and every element needs to know where the mouse cursor is and to know in wich 
direction to move


No they don't, a parent class should take care of all of that.
The elements themselves should not be aware of any of this and should be told (by the parent class) when and how to 
resize/animate/etc..


regards,
Muzak

- Original Message - 
From: "Sander Schuurman" 

To: "Flash Coders List" 
Sent: Thursday, February 12, 2009 5:24 PM
Subject: RE: [Flashcoders] Advanced Rollover Physics/Math...



Do you know kinda where to start... I'm trying to figure out how I would 
program the awareness of the elements.

There must be some kind of idle position, and every element needs to know where the mouse cursor is and to know in wich direction 
to move, and know how big it needs to be according to the mouseposition, and how much space there is inside his 'zone', etc. etc.


pfoe



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


Re: [Flashcoders] Strange XML parsing thing

2009-02-13 Thread Muzak

There is a default namespace, namely: http://www.xignite.com/services/

The following should work:

var myLoader:URLLoader = new URLLoader();
myLoader.addEventListener( Event.COMPLETE, onLoadXML );
myLoader.load( new 
URLRequest("http://www.xignite.com/xquotes.asmx/GetQuote?Symbol=AAPL"; ));
myLoader.dataFormat = "XML";

var ns:Namespace = new Namespace("http://www.xignite.com/services/";);

function onLoadXML( e:Event ):void {
var myXML:XML = new XML(e.target.data);
//trace( myXML);
default xml namespace = ns;
trace("Outcome: ", myXML.Outcome);
trace("Delay: ", myXML.Delay);
}

regards,
Muzak

- Original Message - 
From: "Eric E. Dolecki" 

To: "Flash Coders List" 
Sent: Friday, February 13, 2009 10:08 PM
Subject: [Flashcoders] Strange XML parsing thing



Maybe it's Friday and I'm tired, but this just seems so weird. Something I
have done 8 billions times before and now things are acting up. Code
couldn't be much more simple.
var myLoader:URLLoader = new URLLoader();
myLoader.addEventListener( Event.COMPLETE, onLoadXML );
myLoader.load( new URLRequest( "
http://www.xignite.com/xquotes.asmx/GetQuote?Symbol=AAPL"; ));

function onLoadXML( e:Event ):void
{
var myXML:XML = new XML( e.target.data );
trace( myXML);
}
 
Anyway, When I try to trace out myXML.ExtendedQuote, I get nothing.

When I trace out myXML.Name, I get nothing. I don't see namespaced
nodes anywhere, so what exactly is going on? I just want to get at
some of that data sitting in simple nodes. So freaking weird.

Thanks for any insight,
Eric


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


Re: [Flashcoders] Strange XML parsing thing

2009-02-13 Thread Muzak

Only if you're sure that there will be a namespace defined, if not 
myXML.namespace() will return null (and probably throw an error).
Might not be a big deal in this case, but just mentioning it for archive 
purposes :)

regards,
Muzak

- Original Message - 
From: "Kenneth Kawamoto" 

To: "Flash Coders List" 
Sent: Saturday, February 14, 2009 12:53 AM
Subject: Re: [Flashcoders] Strange XML parsing thing



You can reduce one more line :)

default xml namespace = myXML.namespace();

Kenneth Kawamoto
http://www.materiaprima.co.uk/



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


Re: [Flashcoders] component def doesn't pass params to constructor?

2009-02-18 Thread Muzak

You can either make a component designed for the
stage OR for instancing through code? 


Not really, that's not what it says. 
Just says that you can't (and IMO should never have to) pass arguments to the constructor when dropped on stage.


If you want "talk" to your component both through AS and when on stage, use [Inspectable] getter/setters 


class MyComp {

   [Inspectable]
   public function get symbolName():String {
   return _symbolName
   }
   public function set symbolName(value:String):void {
   _symbolName = value;
   // do stuff with value
   }
}

regards,
Muzak

- Original Message - 
From: "Mendelsohn, Michael" 

To: "Flash Coders List" 
Sent: Wednesday, February 18, 2009 6:55 PM
Subject: RE: [Flashcoders] component def doesn't pass params to constructor?



Hi list...

Researching my own pesky issue (custom components initializing properly
when they're dragged on the stage at author time), I found this:


if you want to create instances of your classes by dragging them to

the stage, keep in mind that their constuctors can not accept arguments.
Also, keep in mind that 
Its a really good idea to pick unique names for your custom classes. 
It's widely agreed class-names should start with the capital letter


Source: http://www.actionscript.org/forums/showthread.php3?t=159332

So, is this true??  You can either make a component designed for the
stage OR for instancing through code?  That seems wrong in AS3.

Any feedback is appreciated.
- Michael M.



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


Re: [Flashcoders] component def doesn't pass params to constructor?

2009-02-19 Thread Muzak

This workflow is more or less what the Flex components follow:

package {

import flash.display.MovieClip;

public class Rectangle extends MovieClip {
 
 private var _prop:String = "Hello";

 private var propChanged:Boolean = false;
 
 public function Rectangle():void {

  trace("Rectangle ::: CONSTRUCTOR");
  init();
 }
 
 private function init():void {

  trace("Rectangle ::: init");
  // do stuff here
  commitProperties();
 }
 
 protected function commitProperties():void {

  trace("Rectangle ::: commitProperties");
  if(propChanged) {
   trace("- propChanged: ", propChanged);
   trace("- prop: ", _prop);
   propChanged = false;
   // do stuff with _prop
  }
 }
 
 [Inspectable(defaultValue="Hello")]

 public function get prop():String {
  trace("Rectangle ::: get prop");
  return _prop;
 }
 public function set prop(value:String):void {
  trace("Rectangle ::: set prop");
  if(value != _prop) {
   _prop = value;
   propChanged = true;
   commitProperties();
  }
 }
}
}

regards,
Muzak

- Original Message - 
From: "Gregory N" 

To: "Flash Coders List" 
Sent: Thursday, February 19, 2009 10:25 AM
Subject: Re: [Flashcoders] component def doesn't pass params to constructor?



Michael,

Haven't you read my reply to one of your prev. questions?
Well, let me quote it here again:
===
Subject: Re: [Flashcoders] my component not instancing properly on  timeline

It seems your problem is similar to one I had with my components.
The matter is that, unlike their behavior in AS2, in AS3 (CS3)
components setters of  [Inspectable] parameters are called lo-o-ong
AFTER constructor

As described here
http://www.bit-101.com/blog/?p=1181
So, even if I set my init() as listener for ADDED_TO_STAGE event...
it's still before setters.

for now, I found a solution:
I put my init() in ENTER_FRAME listener and then remove this listener :-)
This means that listeners are called before 1st  ENTER_FRAME event.
Perhaps my solution isn't too elegant but it works :-)

Also, be sure to duplicate default values for your parameters :-)
===

Note that the above solution is intended to use with sprite-based components.
Perhaps if you subclass UIComponent, the situation with setters is
better... perhaps :-)





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


Re: [Flashcoders] component def doesn't pass params to constructor?

2009-02-19 Thread Muzak


- Original Message - 
From: "Gregory N" 

To: "Flash Coders List" 
Sent: Thursday, February 19, 2009 6:12 PM
Subject: Re: [Flashcoders] component def doesn't pass params to constructor?



Muzak,

Nice addition, thanks for pointing to it.
Frankly, I'd prefer to avoid calling commitProperties() after *each*
of the setters...
Anyway, this way looks better than my enter_frame trick :-)

However, the problem " none of the setters are called if no
inspectable params were changed" still remains. So we have to
duplicate default values in [Inspectable] and constructor/declaration
(or some init function)



You shouldn't rely on them as "init" properties (if that makes sense) but as a way for "a user" to changed them "visually" (in the 
IDE).
So yes, you have to define defaultValue="blah", but I guess that's because Flash (the IDE) has no way of knowing what the 
corresponding internal property is (if any).


private var _prop:String = "Hello";
[Inspectable(defaultValue="Hello")]
public function set prop(value:String):void {
   //
}

Personally I don't see that as a huge problem.

regards,
Muzak 


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


Re: [Flashcoders] component def doesn't pass params to constructor?

2009-02-19 Thread Muzak


- Original Message - 
From: "Gregory N" 

To: "Flash Coders List" 
Sent: Thursday, February 19, 2009 7:17 PM
Subject: Re: [Flashcoders] component def doesn't pass params to constructor?



After some consideration...

If I have, say dozen of Inspectable parameters AND a method that need
several of them to work properly, then I'll have to call this method
after a delay - to be sure that all necessary setters were called
before it..
Thus, turning back to enter_frame trick :-(
Or am I missing something trivial?



With the use of commitProperties() you'll be calling it from your init() method and nothing will happen, as all "xxxChanged" flags 
will be false.

If you set default values for you internal properties, your component should 
work fine.
There should be no need for a delay, if there is, youl probably need to rethink 
your components inner workflow.

regards,
Muzak

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


Re: [Flashcoders] this._livePreviewMask - what is analog in AS3?

2009-02-19 Thread Muzak

Not sure if this has the answer you're looking for (haven't read the article), 
but it came up in a google search:
http://www.adobe.com/devnet/flash/articles/creating_as3_components.html

regards,
Muzak

- Original Message - 
From: "Gregory N" 

To: "Flash Coders List" 
Sent: Thursday, February 19, 2009 9:59 PM
Subject: [Flashcoders] this._livePreviewMask - what is analog in AS3?



I have a component which is built based on user parameters.
And I'm trying to make a Live Preview for it.
The problem is that too many things, including the visual size, are
determined at runtime and/or in component inspector.
So, sometimes part of the picture (in Live Preview) is cropped.

In AS2, there was _livePreviewMask property, which I used to reference
from component's class just as
var lpMask:MovieClip = this._livePreviewMask; 


and then re-position this mask, change its size etc.

Is there something like this in AS3? Or any workaround?

--
--
Best regards,
GregoryN


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


Re: [Flashcoders] Printing table receipt with Flex

2009-02-27 Thread Muzak

Dump them in a datagrid, print the datagrid..


- Original Message - 
From: "Omar Fouad" 

To: "Flash Coders List" 
Sent: Friday, February 27, 2009 5:54 AM
Subject: Re: [Flashcoders] Printing table receipt with Flex



Thanks everybody for the replies... I've been thinking about rendering an
HTML table into a TextField inside a sprite... But as far as I know,
TextFields in flash does not support HTML tables.

What else is recomended?



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


Re: [Flashcoders] find and delete XML nodes

2009-03-08 Thread Muzak

One way to do it is to look for the child elements which id is *not* "b".
Then replace the original child elements with the new ones, or in other words, set the remaining elements as the children of the 
parent:


var s:String = '';
var xml:XML = new XML(s);
trace("before: ", xml.toXMLString());
trace("--");

var elements:XMLList = xml.child.(@id != "b");
trace("elements: ", elements.toXMLString());
trace("--");

xml.setChildren(elements);
trace("after: ", xml.toXMLString());


//output:
before:  
 
 
 
 

--
elements:  

--
after:  
 
 


regards,
Muzak

- Original Message - 
From: "Joel Stransky" 

To: "Flash Coders List" 
Sent: Monday, March 09, 2009 4:38 AM
Subject: [Flashcoders] find and delete XML nodes



I have some xml nodes where I need to evaluate their attributes and delete
them if they meet certain criteria. It's probably simple but its late and
brain fatigue is setting in.

Say I had this node


 
 
 
 


How would I find and delete any  who's id is "b" ?
--
--Joel Stransky
stranskydesign.com


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


Re: [Flashcoders] find and delete XML nodes

2009-03-09 Thread Muzak


delete xml.child.(@id=="b");



You might wanna try that first..

   TypeError: Error #1119: Delete operator is not supported with operand of type XMLList. 


"delete" works as long as the XMLList is not retrieved using an expression, which in this 
case it is: (@id == "b").

So the following works (and deletes all elements):

   var s:String = '';
   var xml:XML = new XML(s);
   delete xml.child;

Bug or feature? Who knows..

regards,
Muzak

- Original Message - 
From: "liutoday" 

To: 
Sent: Monday, March 09, 2009 5:28 AM
Subject: RE: [Flashcoders] find and delete XML nodes







Date: Sun, 8 Mar 2009 23:38:17 -0400
From: j...@stranskydesign.com
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] find and delete XML nodes

I have some xml nodes where I need to evaluate their attributes and delete
them if they meet certain criteria. It's probably simple but its late and
brain fatigue is setting in.

Say I had this node


  
  
  
  


How would I find and delete any  who's id is "b" ?
--
--Joel Stransky
stranskydesign.com
___



delete xml.child.(@id=="b");



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


Re: [Flashcoders] Re: Changing width of seekBar during playback (AS2, FLVPlayback)

2009-03-10 Thread Muzak

The following works for me:

FLVPlayback and SeekBar instance on stage.
A button that, when clicked, will toggle the size of the seekbar.

In the button click handler: 
- resize the seekbar

- set the seekBar property of the video playback to null
- remove the seekbar handle (seekBarHandle_mc) which is otherwise left behind
- reset the seekBar property of the video playback to the same instance as 
before


var SMALL_WIDTH:Number = 100;
var LARGE_WIDTH:Number = 320;

video_fpb.seekBar = video_sb;
video_fpb.contentPath = "paramore_decode_live.flv";

function resizeClickHandler(o:Object):Void {
trace("Application ::: resizeClickHandler");
trace("- seekbar width: " + video_sb._width);
video_sb._width = (video_sb._width == SMALL_WIDTH) ? LARGE_WIDTH : SMALL_WIDTH;
video_fpb.seekBar = null;
removeMovieClip(seekBarHandle_mc);
video_fpb.seekBar = video_sb;
}

video_sb._width = SMALL_WIDTH;
resize_btn.addEventListener("click", resizeClickHandler);

regards,
Muzak

- Original Message - 
From: "jonas magnusson" 

To: 
Sent: Tuesday, March 10, 2009 10:39 AM
Subject: [Flashcoders] Re: Changing width of seekBar during playback 
(AS2,FLVPlayback)



Probably solved the seekbar issue.

If anyone happen to have the same problem in the future:

Seems I can get it working by making two seekbars and encapsulating them in
container_mc's.
On "newSize" i set the new size of both seekbars, do remove movieclip on
"prev_container.seekBarHandle_mc" then set "flvplayback.seekBar =
new_container.new_SeekBar".
Then i hide the "prev_container" with _visible=false and make the
"new_container" _visible=true.

The handle is now draggable and i remove the old dead handles, the
left/right limits are updated and the visuals are also updated.

Thanks for listening :)

/Jonas



On Mon, Mar 9, 2009 at 5:55 PM, jonas magnusson wrote:


Hi List,

I would like to make a FLV player that scales up the width depending on
Stage.width.
The width is different depending on size when starting up, and the user
monitor size when in fullscreen.

I am using the FLVPlayback component AS2.0 (several months of work put in
already).
Video can easily be scaled up, but the seekbar is a big problem.

When i change the width of the seekbar, the flvplayback/seekbar does not
"realize" the new limits of the handle.

Most often the seekBar just takes on a temporary look but then reverts back
after video-end.
So no new left-right limits + temporary graphic change.

Solutions tried:

Placing differently sized seekbars of the same name in different keyframes,
jumping between keyframes (no change at all)

Setting width: "seekBar._width = 300" or "seekBar.progress_mc._width = 300"
(temporary background-only change)

Switching streams after width-change to force update.


Having double seekbars, updating the size of one, then switching between
them (flvplb.seekBar = seekBar2).
Works really well for the new limits, the handle now moves between new
limits. Problem with this solution is that the new handle is not clickable.
Also, there are a lot of "dead handles" from the previous switches. The
"click-area" remains behind the first dead handle.
I managed to remove the graphics of previous handles by
using "handle_mc.removeMovieClip()", but the new handle does not get
assigned the functionality"onPress" -> "startDragging.."


Any and all suggestions appreciated!

/Jonas


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


Re: [Flashcoders] A very simply question of XML toString()

2009-03-19 Thread Muzak

You could look into the DataProvider class:

import fl.data.DataProvider;

var dp:DataProvider;
var myXML:XML = 


 
  Dictionary 1
 
 
  Dictionary 2
 
;

dp = new DataProvider(myXML);
trace("dp length: ", dp.length);
var item:Object = dp.getItemAt(0);
trace("first item: ", item);
trace("item title: ", item.title);

So rather than storing just the title (in an array), you store each book node 
as an Object (Array of Objects).

regards,
Muzak

- Original Message - 
From: "ACE Flash" 

To: "Flash Coders List" 
Sent: Thursday, March 19, 2009 6:11 PM
Subject: [Flashcoders] A very simply question of XML toString()



Hey there,

I was trying to parse the XML to get all value of  and store them
into array at once. Do I have to use loop to push them into an Array or
there is a shortcut for doing this?

I'd like to get something like this...

var arr:Array = new Array();

// to trace arr
arr[0] = Dictionary 1
arr[1] = Dictionary 2

Thank you



  1. var myXML:XML =
  2. 
  3. 
  4. Dictionary 1
  5. 
  6. 
  7. Dictionary 2
  8. 
  9. ;
  10. trace( myXML.book.title.toString() )
___
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] Flash Future - Unity3D, iPhone and performance

2009-03-20 Thread Muzak


Unity is a multiplatform game development tool


Banner ads, really??

I'd like to be able to tell a client some day
who has a banner campaign only capable in Unity that it has a large enough
install base.


That to me sounds like cramming a banner ad into the Quake engine.

One of the reasons Flash became so popular was because of its small filesize.
The Unity plugin is about 11mb, flash plugin (fp10) is around 1.5mb.

I'm not surprised apple doesn't want flash on their iPhone because of 
performance issues. But the Flash Player is a slow virtual machine, 
isn't that right?


I'd say for a 1.5mb plugin its damn fast and it gets better with every version.

Yes the Flash Platform has wonderful tool 
and framework to create applications, but how long before someone is 
coming all these tools (such as AIR, the Flex framework, layouts and 
components)? Maybe Unity? Maybe another?


People have been saying this for years now, still have to see it happen.
Silverlight anyone??

Even if Flash will be here for a great bunch of years, I don't see a 
real good future unless they re-write a real new Virtual Machine that is 
taking all the power you can use from a computer.


At what cost?
I'm pretty sure this has nothing to do with Adobe not being able to write a 
"decent" VM.
Meaning, I'm sure they're capable of doing so, but at what cost? 
Well, for one, filesize comes to mind again.


Is there a market for Unity 3D? I'm sure there is and their demo site shows 
that as well.
Does this affect Adobe/Flash? I seriously doubt it. 
As Taka pointed out:

Unity is pretty kick-ass, but Unity != Flash

One is a game development platform, the other a rich (internet) application 
platform.

regards,
Muzak

- Original Message - 
From: "Joel Stransky" 

To: "Flash Coders List" 
Sent: Friday, March 20, 2009 8:53 PM
Subject: Re: [Flashcoders] Flash Future - Unity3D, iPhone and performance



I'm not suggesting Unity is a replacement for flash so much as that it's
worth having a viable market. I'd like to be able to tell a client some day
who has a banner campaign only capable in Unity that it has a large enough
install base.

On Fri, Mar 20, 2009 at 3:00 PM, Taka Kojima  wrote:



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


Re: [Flashcoders] Zend AMF Framework Paramaters error

2009-03-21 Thread Muzak

Haven't had a chance to look at the Zend remoting implementation yet.
Have you tried sending an object ?

var params:Object = {path:"images/", ba:ba};
NC.call("PHPClass.function", Res, params);

Not sure about the syntax to retrieve those in PHP, as I don't do PHP :)

// wild guess
function writeJpg($args) {
   $args["path"];
   $args["ba"];
}

regards,
Muzak

- Original Message - 
From: "Omar Fouad" 

To: "Flash Coders List" 
Sent: Saturday, March 21, 2009 5:50 PM
Subject: [Flashcoders] Zend AMF Framework Paramaters error


Hello,

I've got some trouble with the Zend Framework (AMF) and ActionScript, in
sending multiple parameter to a PHP Function.
The user loads an image file from the local hard drive using FileReference
into the Flash Movie than I take the Image's Bitmap Data, encode it to with
JPGEncoder (CoreLib), get the byteArray of it and pass it to a PHP function
though a NetConnection Instance like this.

Main.as -

//ba is my byteArray from the encoder

var NC:NetConnection = new NetConnection();
var Res:Reponder = new Responder(onSuccess, onError);

NC.connect(zend_amf_server);
NC.call("PHPClass.function", Res, ba);
[...]

PHPClass.php -

function __construct() {...} //the construct code here

function writeJpg( $byteArray ) {
 $fp = fopen('data.jpg', 'wb');
   fwrite( $fp, implode("",$byteArray));
   fclose( $fp );
   return "File Saved";
}

This work like a charm, the file is created I get the response. I tried to
pass another argument to the function, a path string that holds the name of
the folder to be created like this.

Main.as -
var path:String = "images/"
NC.call("PHPClass.function", Res, ba, path);

PhpClass.php -

function writeJpg( $byteArray, $path ) {
 $fp = fopen($path.'data.jpg', 'wb');
   fwrite( $fp, implode("",$byteArray));
   fclose( $fp );
   return "File Saved";
}

Apparently this does not work. in the response I get this message:
"Error #2044: Unhandled NetStatusEvent:. level=error,
code=NetConnection.Call.BadVersion
   at fileUploader_fla::MainTimeline/onSave()" the image file is corrupted
and no folder is created.

Apparently the NC.call, cannot pass more than one parameter. I've been
searching about this problem on the web and I read that this is a bug in an
older version of zendAMF, I've downloaded the latest release, restarted by
MAMP server, but I still have the same problem...

How can this be achieved?

Thanks.

--
Omar M. Fouad - Adobe Flashâ„¢ Platform Developer

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


Re: [Flashcoders] do we still have to check to see if loaded > 10 bytes?

2009-03-24 Thread Muzak

In AS3 you usually listen for the "complete" event, which is triggered when 
loading is completed.

regards,
Muzak

- Original Message - 
From: "allandt bik-elliott (thefieldcomic.com)" 

To: "Flash Coders List" 
Sent: Tuesday, March 24, 2009 5:03 PM
Subject: [Flashcoders] do we still have to check to see if loaded > 10 bytes?



in as2 there used to be a thing where you had to check to make sure loaded
was above 10 bytes or it would sometimes give a false reading

(so you might see if (this.getBytesLoaded == this.getBytesTotal() &&
this.getBytesLoaded > 10) for instance)

does the same apply to as3 or can i safely leave that part out of my code?

thanks
a


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


Re: [Flashcoders] do we still have to check to see if loaded > 10bytes?

2009-03-24 Thread Muzak

I'm confused, Martijn's ImageLoader is AS2.
Are you trying to use that in AS3?

http://www.martijndevisser.com/blog/2006/imageloader-class-for-flash-8/
http://www.martijndevisser.com/download/ImageLoader.as

regards,
Muzak

- Original Message - 
From: "Karl DeSaulniers" 

To: "Flash Coders List" 
Sent: Tuesday, March 24, 2009 5:50 PM
Subject: Re: [Flashcoders] do we still have to check to see if loaded > 10bytes?


I have an issue with dynamic content not triggering my code when its  
complete.

I am trying to call the progress from a external class..

any sample code that anyone can give to implement this easily.

The class is com.martijndevisser.ImageLoader

Please pardon my Newbieizm I am self taught AS2 and evidently I  
havent taught myself enough. : |


Karl DeSaulniers
Design Drumm
http://designdrumm.com

On Mar 24, 2009, at 11:41 AM, Muzak wrote:

In AS3 you usually listen for the "complete" event, which is  
triggered when loading is completed.


regards,
Muzak



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


Re: [Flashcoders] do we still have to check to see if loaded >10bytes?

2009-03-24 Thread Muzak

Not sure, my AS2 is *very* rusty, but think this should work:

import com.martijndevisser.ImageLoader;

function onLoadProgress(target:MovieClip, bytesLoaded:Number, 
bytesTotal:Number):Void {
   trace("Application ::: onLoadProgress");
   trace("- target: " + target)
   trace("- bytesLoaded: " + bytesLoaded);
   trace("- bytesTotal: " + bytesTotal);
}

function onLoadInit(target:MovieClip):Void {
   trace("Application ::: onLoadInit");
   trace("- target: " + target);
}

var loader:ImageLoader = new ImageLoader();
loader.addListener(this);
loader.loadImage( "some_image.jpg", image_mc );

regards,
Muzak

- Original Message - 
From: "Karl DeSaulniers" 

To: "Flash Coders List" 
Sent: Tuesday, March 24, 2009 9:19 PM
Subject: Re: [Flashcoders] do we still have to check to see if loaded >10bytes?



No. This project is still as2

Sent from losPhone

On Mar 24, 2009, at 3:03 PM, "Muzak"  wrote:


I'm confused, Martijn's ImageLoader is AS2.
Are you trying to use that in AS3?

http://www.martijndevisser.com/blog/2006/imageloader-class-for- 
flash-8/

http://www.martijndevisser.com/download/ImageLoader.as

regards,
Muzak



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


Re: [Flashcoders] Tween AS3 issue with Firefox

2009-03-25 Thread Muzak

My guess is whatever he's talking about is beyond the login?

- Original Message - 
From: "Zeh Fernando" 

To: "Flash Coders List" 
Sent: Thursday, March 26, 2009 12:01 AM
Subject: Re: [Flashcoders] Tween AS3 issue with Firefox



What animation? It works the same in both FF and IE here and there's no
Tween whatsoever.

Zeh

On Wed, Mar 25, 2009 at 3:23 PM, Reina Lyn Ben  wrote:


has anyone had the same problem. I have a website up..
http://kozonline.com/epk the animation is created in AS3, when I use
firefox, the animation/transition freezes, I've found solutions online like
creating a variable and store the tween there instead of being dependent on
the garbage Collector feature that tween have. When I test the site on IE,
it animates fine and finishes the tween..

--


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


Re: [Flashcoders] Tween AS3 issue with Firefox

2009-03-26 Thread Muzak

My curiosity was caught, but it's difficult to help when someone is asking
for help on something so vague.


My thoughts exactly.

- Original Message - 
From: "Zeh Fernando" 

To: "Flash Coders List" 
Sent: Thursday, March 26, 2009 5:26 PM
Subject: Re: [Flashcoders] Tween AS3 issue with Firefox



That's my guess too, but in that case it would have made sense for him to
give us the "password" to see whatever he wanted us to see.

My curiosity was caught, but it's difficult to help when someone is asking
for help on something so vague.





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


Re: [Flashcoders] ?: how to prevent users to copy text from aTextArea?

2009-03-28 Thread Muzak


The problem seems to be that TextArea uses the "enabled" value to set the inner 
textField's selectable property value.

 protected function updateTextFieldType():void {
  textField.type = (enabled && _editable) ? TextFieldType.INPUT : 
TextFieldType.DYNAMIC;
  textField.selectable = enabled;
  textField.wordWrap = _wordWrap;
  textField.multiline = true;
 }

So each time the updateTextFieldType() method is called, no matter what you set TextArea.textField.selectable to, it will revert to 
the TextArea.enabled value.

That's why :

   details_ta.textField.selectable = false;

doesn't really work.

So it's not really a bug, just a (very) bad decision.
Why it was done that way, who knows..

To get the TextArea to work the way you want, you can extend it and override the updateTextFieldType() method and add a selectable 
property, like so:


package {

import fl.controls.TextArea;
import flash.text.TextFieldType;

public class TextArea2 extends TextArea {

 private var _selectable:Boolean = true;

 override protected function updateTextFieldType():void {
  textField.type = (enabled && _editable) ? TextFieldType.INPUT : 
TextFieldType.DYNAMIC;
  textField.selectable = _selectable;
  textField.wordWrap = _wordWrap;
  textField.multiline = true;
 }

 public function get selectable():Boolean {
  return _selectable;
 }
 public function set selectable(value:Boolean):void {
  _selectable = value;
  super.textField.selectable = value;
  updateTextFieldType()
 }

}
}


Tested with the code you provided earlier (normal TextArea on stage):

package {

import flash.display.Sprite;
import fl.controls.TextArea;
import flash.text.TextField;
import flash.events.Event;
import TextArea2;

public class TestTextArea extends Sprite {

 public var details_ta:TextArea;
 public var details2_ta:TextArea2;

 public function TestTextArea() {
  addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
  init();
 }

 private function init():void {
  trace("TestTextArea ::: init");
  details2_ta = new TextArea2();
  details2_ta.selectable = false;
  details2_ta.x = 220;
  details2_ta.y = 10;
  details2_ta.width = 200;
  details2_ta.height = 100;
  addChild(details2_ta);
 }

 private function addedToStageHandler(evt:Event):void {
  trace("TestTextArea ::: addedToStageHandler");
  var msg:String = "Lorem ipsum dolor sit amet, consectetuer adipiscing 
elit.";
  details_ta.htmlText = msg;
  details2_ta.htmlText = msg;
 }

}
}

regards,
Muzak

- Original Message - 
From: "Keith Reinfeld" 

To: "'Flash Coders List'" 
Sent: Saturday, March 28, 2009 10:11 PM
Subject: RE: [Flashcoders] ?: how to prevent users to copy text from aTextArea?



Then again there is this:

package{
//imports
import fl.controls.TextArea;
import flash.text.TextField;

public class CustomTextArea extends TextArea{
//vars
private var internalTextField:TextField;

public function CustomTextArea(){
super();
internalTextField = TextField(this.textField);
}

public function set selectable(b:Boolean):void{
internalTextField.mouseEnabled = b;
this.editable = b;
}

public function get selectable():Boolean{
return internalTextField.mouseEnabled;
}
}
}

Example usage:

package{
//imports
import flash.display.MovieClip;
import CustomTextArea;

public class Application extends MovieClip{
//vars
private var customTA:CustomTextArea;

public function Application(){
init();
//addEventListener(KeyboardEvent.KEY_DOWN,
onUpArrow);
}

private function init():void{
customTA = new CustomTextArea();

addChild(customTA);
customTA.x = 0;
customTA.y = 0;
customTA.width = 150;
customTA.height = 90;
customTA.htmlText = "Lorem
ipsum dolor sit amet, consectetuer adipiscing elit.Lorem ipsum dolor sit amet, consectetuer adipiscing
elit.Lorem ipsum dolor sit amet,
consectetuer adipiscing elit.Lorem ipsum
dolor sit amet, consectetuer adipiscing elit.";

trace("customTA.selectable =",customTA.selectable);
customTA.selectable = false;
trace("customTA.selectable =",customTA.selectable);
}
}
}

HTH

Regards,

-Keith


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


Re: [Flashcoders] AS3 Object reference

2009-03-28 Thread Muzak

There's no "_width" in AS3.. it's "width".
Array access notation should work fine:

photoStrip_mc["thumbnail" + i + "_mc"].width;


As a sidenote, you're better off storing references in an array for easy access 
later.

myClips = new Array();
var len:uint = 10;
for(var i:uint=0; i- Original Message - 
From: "TS" 

To: "'Flash Coders List'" 
Sent: Sunday, March 29, 2009 3:09 AM
Subject: [Flashcoders] AS3 Object reference



Trying to cylec through some objects. This doesn't seem to work in AS3 as it
does in AS2. Is there an equivalent in AS3?



photoStrip_mc["thumbnail" + i + "_mc"]._width



Thanks ahead, T



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


Re: [Flashcoders] ?: how to prevent users to copy text from aTextArea?

2009-03-29 Thread Muzak

That depends..
If you have a component-heavy application with your own custom styles for 
instance, it might be better to use a TextArea.
Or you could take it a step further and make this into a new component (and 
even make it an mxp for distribution).

Then again, if all you need is one (and one only) non-selectable textfield, 
sure grab a TextField and ScrollBar and move on :)

I mearly wanted to present a better solution (IMO) than overlaying a TextArea with a shape, which is to actually fix what seems to 
be broke.


regards,
Muzak

- Original Message - 
From: "Cor" 

To: "'Flash Coders List'" 
Sent: Sunday, March 29, 2009 1:00 PM
Subject: RE: [Flashcoders] ?: how to prevent users to copy text from aTextArea?



Just interested.
Is all this worth the hassle?
I mean instead using a TextArea, I would go for a normal TextField and a
custom scrollbar all in 1 movieclip.
And set the needs.

Cor.


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Muzak
Sent: zondag 29 maart 2009 1:20
To: Flash Coders List
Subject: Re: [Flashcoders] ?: how to prevent users to copy text from
aTextArea?


The problem seems to be that TextArea uses the "enabled" value to set the
inner textField's selectable property value.

 protected function updateTextFieldType():void {
  textField.type = (enabled && _editable) ? TextFieldType.INPUT :
TextFieldType.DYNAMIC;
  textField.selectable = enabled;
  textField.wordWrap = _wordWrap;
  textField.multiline = true;
 }

So each time the updateTextFieldType() method is called, no matter what you
set TextArea.textField.selectable to, it will revert to
the TextArea.enabled value.
That's why :

   details_ta.textField.selectable = false;

doesn't really work.

So it's not really a bug, just a (very) bad decision.
Why it was done that way, who knows..

To get the TextArea to work the way you want, you can extend it and override
the updateTextFieldType() method and add a selectable
property, like so:

package {

import fl.controls.TextArea;
import flash.text.TextFieldType;

public class TextArea2 extends TextArea {

 private var _selectable:Boolean = true;

 override protected function updateTextFieldType():void {
  textField.type = (enabled && _editable) ? TextFieldType.INPUT :
TextFieldType.DYNAMIC;
  textField.selectable = _selectable;
  textField.wordWrap = _wordWrap;
  textField.multiline = true;
 }

 public function get selectable():Boolean {
  return _selectable;
 }
 public function set selectable(value:Boolean):void {
  _selectable = value;
  super.textField.selectable = value;
  updateTextFieldType()
 }

}
}


Tested with the code you provided earlier (normal TextArea on stage):

package {

import flash.display.Sprite;
import fl.controls.TextArea;
import flash.text.TextField;
import flash.events.Event;
import TextArea2;

public class TestTextArea extends Sprite {

 public var details_ta:TextArea;
 public var details2_ta:TextArea2;

 public function TestTextArea() {
  addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
  init();
 }

 private function init():void {
  trace("TestTextArea ::: init");
  details2_ta = new TextArea2();
  details2_ta.selectable = false;
  details2_ta.x = 220;
  details2_ta.y = 10;
  details2_ta.width = 200;
  details2_ta.height = 100;
  addChild(details2_ta);
 }

 private function addedToStageHandler(evt:Event):void {
  trace("TestTextArea ::: addedToStageHandler");
  var msg:String = "Lorem ipsum dolor sit amet, consectetuer
adipiscing elit.";
  details_ta.htmlText = msg;
  details2_ta.htmlText = msg;
 }

}
}

regards,
Muzak



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


Re: [Flashcoders] Best data type for Zend AMF

2009-03-30 Thread Muzak

For database type data, Array of Objects.
Forget about XML.

With Coldfusion (and remoting) you can grab a database query result and just send that straight to Flash/Flex and it will be 
transformed into an Array of Objects automatically.


In CF it's as simple as:



   SELECT * FROM table_name



Seems they're still working on mapping PHP to AS objects:
http://wadearnold.com/blog/?p=54
Allthough, the article is from sept 2008, so it may have been implemented by 
now.

So if class mappings are implemented (still have to take Zend AMF for a spin) then that's the *best* option, but probably not the 
*fastest*.

At least in Coldfusion transforming plain vanilla objects into typed objects 
slows things down (especially with lots of data).

regards,
Muzak

- Original Message - 
From: "Sidney de Koning" 

To: "Flash Coders List" 
Sent: Monday, March 30, 2009 12:05 PM
Subject: [Flashcoders] Best data type for Zend AMF



Hi List,

I'm using  Zend AMF, and i'd like to know what is the best way and  fastest to 
transfer data.
For instance; do i create an array from database data in PHP and send  it to flash? Or do i formatted array data from a database 
to xml and  send that to flash?

Which is the fastest? And more specifically; what datatype is the  fastest.

Sidney de Koning - be a geek, in rockstar style!
Flash / AIR Developer @ www.funky-monkey.nl
Technical Writer @ www.insideria.com


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


Re: [Flashcoders] Best data type for Zend AMF

2009-03-30 Thread Muzak
AMFPHP did this really well with result sets too - straight out of the 
box like CF.


Yeah, that's what I expect Zend AMF to do as well, but I haven't tried it yet.
Maybe I'll take it for a spin this evening if I find the time..

The only *gotcha* with sending query results straight from CF to Flex/Flash is 
that table column names all become uppercase.
Not sure if AMFPHP did the same (been too long since I used it).
So that might be something to look out for with Zend AMF as well, but it may 
just be a (annoying) CF thing.

Let's say you have a user table with "firstName" and "lastName" columns.
When sending a query result straight to Flex/Flash (from CF) it looks like this:

[{FIRSTNAME:"value", LASTNAME:"value"}, {FIRSTNAME:"value", LASTNAME:"value"}];
rather than:
[{firstName:"value", lastName:"value"}, {firstName:"value", lastName:"value"}];


regards,
Muzak

- Original Message - 
From: "Glen Pike" 

To: "Flash Coders List" 
Sent: Monday, March 30, 2009 4:23 PM
Subject: Re: [Flashcoders] Best data type for Zend AMF


AMFPHP did this really well with result sets too - straight out of the 
box like CF.


Muzak wrote:

For database type data, Array of Objects.
Forget about XML.

With Coldfusion (and remoting) you can grab a database query result 
and just send that straight to Flash/Flex and it will be transformed 
into an Array of Objects automatically.


In CF it's as simple as:



   SELECT * FROM table_name



Seems they're still working on mapping PHP to AS objects:
http://wadearnold.com/blog/?p=54
Allthough, the article is from sept 2008, so it may have been 
implemented by now.


So if class mappings are implemented (still have to take Zend AMF for 
a spin) then that's the *best* option, but probably not the *fastest*.
At least in Coldfusion transforming plain vanilla objects into typed 
objects slows things down (especially with lots of data).


regards,
Muzak



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


Re: [Flashcoders] Best data type for Zend AMF

2009-03-30 Thread Muzak

If Zend AMF supports mapping, then it should be possible with pure AS3.
Think you'll need to use flash.net.registerClassAlias() to map the AS class to 
a PHP class.
http://livedocs.adobe.com/flex/3/langref/flash/net/package.html#registerClassAlias()

That will do the same thing as the Flex [RemoteClass] metadata tag.

So in the VO constructor, make a call to registerClassAlias():
   registerClassAlias("php.package.classname", VOClass);

No idea if PHP does packages tho (someone else does the PHP stuff for me, I'm a CF guy), so you might just need the php class name 
(without package).


http://www.roboncode.com/articles/187
http://framework.zend.com/manual/en/zend.amf.server.html#zend.amf.server.typedobjects

regards,
Muzak

- Original Message - 
From: "Sidney de Koning" 

To: "Flash Coders List" 
Sent: Monday, March 30, 2009 4:40 PM
Subject: Re: [Flashcoders] Best data type for Zend AMF



Nice one guys, thanks for the response.
Since i'm not at all into Flex, in the video he talks about binding  (and 
mapping them to ValueObjects).
My question is can i do this with pure AS3?

Cheers,

Sid



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


Re: [Flashcoders] Cross-domain policy - why is Flex more forgiving thanFlash?

2009-03-31 Thread Muzak
And, I've also discovered that Flex is more forgiving. I can pull in content from another domain without said crossdomain.xml by 
using a HTTPService component.


That's not correct.
Doesn't matter if it's Flex or Flash. It's the Flash Player that enforces 
security, not the tool that created the swf.
Different rules apply to different swf versions, so if Flex compiles to fp9 and Flash CS4 compiles to fp10, you may see different 
results.

Even minor revisions may show different results (e.g. 9.0.45 vs 9.0.124).

But why on earth is that so? I mean, the same file can easily be read by an ordinary browser!? What on earth could i concoct with 
my devious, malignant Flash application with the same file?


Well, it's not about what your intensions are, they may be all good,
but not everyone has those same good intensions :)

Think about banner ads that are displayed *wherever*.
Do you really want those to be able to read/load/execute anything they feel 
like from your site/server?

There's quite alot of info on the Adobe site regarding security:
http://www.adobe.com/devnet/flashplayer/security.html
http://www.adobe.com/devnet/security/
http://www.adobe.com/products/flashplayer/security/

regards,
Muzak

- Original Message - 
From: "Johan Nyberg" 

To: 
Sent: Tuesday, March 31, 2009 2:17 PM
Subject: [Flashcoders] Cross-domain policy - why is Flex more forgiving 
thanFlash?


I'm getting tired of Flash's unforgiving cross-domain policy. Why can't I read an xml-feed, content produced by a php file or a 
simple text file without Flash wagging that finger in my face saying "No, no, you can't, not without that site allowing your site 
access in the crossdomain.xml".


But why on earth is that so? I mean, the same file can easily be read by an ordinary browser!? What on earth could i concoct with 
my devious, malignant Flash application with the same file?


And, I've also discovered that Flex is more forgiving. I can pull in content from another domain without said crossdomain.xml by 
using a HTTPService component.


I would greatly appreciate if anyone could shed some light on this. And, if 
anyone can point out if I'm doing anything wrong here.

But please don't tell me to get my domain name into that other servers cross-domain policy file. There are many situations where 
this is not possible, and where it would still be legitimate to read content from that site.


And, as I said before, the browser doesn't need that permission. Nor does Flex, 
apparently.

Regards,

--
Johan Nyberg

Web Guide Partner


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


Re: [Flashcoders] Cross-domain policy - why is Flex more forgiving thanFlash?

2009-03-31 Thread Muzak

If everybody and everything can
read an XML on a random server, why can't Flash, it doesn't make any sense.


Because the Flash Player can't determine if you're *allowed* to read that particular xml file or not, nor does it know your 
intensions.
So rather than allowing it and hoping for the best, it shuts the door for everyone and provides a means to open a backdoor (if you 
like) through the use of policy files.


When this was first implemented (Flash 6) this was highly annoying since noone 
out there had policy files in place.
Nowadays service providers (Xmethods/Yahoo/Amazon/etc..) have those in place 
and their public services can be used with Flash.

If there's a public service you'd like to use and they don't have a policy file in place, contact them, explain them what you want 
and why and point them to the appropriate pages on the Adobe site.

I've done so in the past and up to now I never had a "no go".

http://www.xmethods.net/crossdomain.xml
http://www.yahoo.com/crossdomain.xml
http://search.yahooapis.com/crossdomain.xml

http://developer.yahoo.com/faq/#flash

The way I see it, crossdomain policy files are here to stay, so might as well 
deal with it :)

regards,
Muzak

- Original Message - 
From: "Meinte van't Kruis" 

To: "Flash Coders List" 
Sent: Tuesday, March 31, 2009 5:59 PM
Subject: Re: [Flashcoders] Cross-domain policy - why is Flex more forgiving 
thanFlash?



Still, I agree with John, on the XML part. If everybody and everything can
read an XML on a random server, why can't Flash, it doesn't make any sense.



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


Re: [Flashcoders] Proof of Concept - HTTPService objectdoesn't requirecrossdomain-policy file

2009-04-02 Thread Muzak
I haven't really looked into the differences between standalone and AIR - haven't created a projector in years - but my guess is 
that because you have to install an AIR application (and are therefor informed/warned about the risks that entails) it is allowed to 
do more than a standalone executable (projector).


So basically there are 3 different player security models:
- Standalone
- AIR
- Browser plugin

Here's an article explaining the AIR security model:
http://www.adobe.com/devnet/air/articles/introduction_to_air_security.html

@Johan:

Please check out the code included at the end of this post. I've created a small AIR application (with a certificate) and it works 
without a problem.



Am I missing something?


Yes, as I explained earlier, this has nothing to do with HTTPService.
This is about different sandboxes: standalone, AIR and the browser.

regards,
Muzak

- Original Message - 
From: "Glen Pike" 

To: "Flash Coders List" 
Sent: Thursday, April 02, 2009 11:54 AM
Subject: Re: [Flashcoders] Proof of Concept - HTTPService objectdoesn't 
requirecrossdomain-policy file



Hi,

   It's an AS2 Flash application running standalone on Linux requesting stuff from the localhost on various ports - the irritating 
thing is I still have to implement x-domain files / responses on every port I connect to, I tried setting a policy server up on 
the default port as per the instructions on the devnet site, but this did not work..


   My point is that the standalone Flash application is an exe, like Air, so implies that a higher level of trust is required to 
run it, therefore it should be allowed more "liberty" than a browser based Flash app.  This is one of the most irritating things 
about doing standalone stuff - I can't load files from the file system because I am requesting over the network.  I am doing 
standalone because this is legacy stuff for a kiosk...


   Glen



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


Re: [Flashcoders] SWIZ + AS3

2009-04-06 Thread Muzak

You should probably try the framework specific mailing list:
http://groups.google.com/group/swiz-framework

- Original Message - 
From: "Gert-Jan van der Wel" 

To: 
Sent: Monday, April 06, 2009 11:02 AM
Subject: [Flashcoders] SWIZ + AS3



Hi everybody,

After seeing Introduction to the Swiz Framework for Flex by Chris  
Scott I got enthusiastic about SWIZ. I wanted to use it for an AS3  
project, but I'm having some trouble getting started. I'm using  
Eclipse (3.4.2) with FDT 3. I downloaded the swiz.swc and added it to  
my linked libraries. Then I added the keep-as3-metadata to my flex- 
config.xml


  
  Autowire
  Mediate
  

I created a Flash project with Main, Bean MyController, MyService  
classes, the sample can be downloaded here. I hope somebody can help  
me out to get started.


Cheers,
Gert-Jan


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


Re: [Flashcoders] ColorTransform GTween

2009-04-08 Thread Muzak

but is there really nobody out there who knows how to do it ?


I'm sure Mr. Google knows.
http://www.google.com/search?hl=en&q=tween+colortransform&meta=&aq=1&oq=tween+color

And I'm pretty sure AnimationPackage has some color stuff.
http://www.alex-uhlmann.de/flash/animationpackage/

- Original Message - 
From: "Jiri" 

To: "Flash Coders List" 
Sent: Wednesday, April 08, 2009 8:11 PM
Subject: Re: [Flashcoders] ColorTransform GTween



Thanx Ashum...,but is there really nobody out there who knows how to do it ?

Jiri

Ashim D'Silva wrote:

Never used GTween before, but Grant is joining forces with Jack Doyle
of TweenLite, and that library is incredibly easy to use. If the
possibility exists, you might want to switch libraries, and soon, you
should get the best of both worlds.

2009/4/9 Jiri :

I am experimenting with GTween from Grant Skinner. I cant seem to figure out
how to do a color transform. Does somebody know how to do that?
Here is what i have:

import fl.motion.easing.*;
import com.gskinner.motion.*

var colorInfo:ColorTransform = clip.transform.colorTransform;

trace(colorInfo);

var myTween:GTween = new GTween(clip,2,{color:0xFFcc00});
myTween.setAssignment(clip.transform,"colorTransform");

//resulting in flickering of color of the clip.

Jiri


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


Re: [Flashcoders] Dragging loads of sound files from library into amovie clip

2009-04-09 Thread Muzak

Hey Paul,

Use jsfl again..

- create a new movieclip in library (mc:audio)
- edit the movieclip (enter editMode)
- loop through all library items
- if item == "sound"
   - create new layer in movieclip
   - add sound to new layer


fl.outputPanel.clear();
fl.trace("Audio to MovieClip Command");

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

// create movieclip for audio
lib.addNewItem("movie clip", "mc:audio");
lib.setItemProperty("linkageExportForAS", false);
lib.setItemProperty("linkageExportForRS", false);
lib.editItem("mc:audio");

var tl = doc.getTimeline();

var libItems = lib.items;
var len = libItems.length;
var item;
var frIndex;
fl.trace("library items: " + len);
for(var i=0; i
You should be able to figure that out from the jsfl docs :)

regards,
Muzak

- Original Message - 
From: "Paul Steven" 

To: "'Flash Coders List'" 
Sent: Wednesday, April 08, 2009 8:30 AM
Subject: [Flashcoders] Dragging loads of sound files from library into amovie 
clip



Related to my previous post, I now need to drag about 300 audio files from
the library into a movie clip.

Essentially this is to ensure they are preloaded in my game. The method I
use is to create a movie clip that has all the audio files on separate
layers. This movie clip is then nested inside another movie clip and placed
on the second keyframe with a stop action on the first.

I am wondering if there is a magic way to drag say 300 audio files from the
library and for flash (Flash CS3) to automatically create 300 layers, one
layer for each audio file?

Thanks in advance

Paul

___
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] Dragging loads of sound files from library intoamovie clip

2009-04-09 Thread Muzak

This will add the audio mc to the main timeline in frame 10 (add it after 
doc.exitEditMode(); in the previous script):

// main timeline
tl = doc.getTimeline();
frIndex = tl.addNewLayer("ALL AUDIO");
tl.insertFrames(10);
tl.insertBlankKeyframe(10);
tl.currentFrame = 10;
lib.addItemToDocument({x:0, y:0}, "mc:audio");

Depending on how your FLA is built up, you may have to remove: 
tl.insertFrames(10)

regards,
Muzak

- Original Message - 
From: "Muzak" 

To: "Flash Coders List" 
Sent: Thursday, April 09, 2009 4:27 PM
Subject: Re: [Flashcoders] Dragging loads of sound files from library 
intoamovie clip



Hey Paul,

Use jsfl again..

- create a new movieclip in library (mc:audio)
- edit the movieclip (enter editMode)
- loop through all library items
- if item == "sound"
   - create new layer in movieclip
   - add sound to new layer


fl.outputPanel.clear();
fl.trace("Audio to MovieClip Command");

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

// create movieclip for audio
lib.addNewItem("movie clip", "mc:audio");
lib.setItemProperty("linkageExportForAS", false);
lib.setItemProperty("linkageExportForRS", false);
lib.editItem("mc:audio");

var tl = doc.getTimeline();

var libItems = lib.items;
var len = libItems.length;
var item;
var frIndex;
fl.trace("library items: " + len);
for(var i=0; i
You should be able to figure that out from the jsfl docs :)

regards,
Muzak



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


Re: [Flashcoders] AS3: if (urlvars.bids != null) trace(urlvars.bids); still prints null?

2009-04-09 Thread Muzak

If the variable is actually present, it will have a value: an emtpy string.
And you may have to check for "0" instead of 0, again a string.

if (urlvars.bids != "" && urlvars.bids != "0") 



regards,
Muzak

- Original Message - 
From: "Alexander Farber" 

To: "Flash Coders List" 
Sent: Thursday, April 09, 2009 3:13 PM
Subject: [Flashcoders] AS3: if (urlvars.bids != null) trace(urlvars.bids);still 
prints null?



Hello,

does anybody please have an idea, why would this code:

private function handleComplete(event:Event):void {
var urlvars:URLVariables = event.target.data;
..
if (urlvars.bids != null && urlvars.bids != 0) {
trace(urlvars.bids);
   .
   }
}

still print out "null"? Is it maybe because null != null in AS3
and I have to perform some other check similar to isNaN()?

Thank you
Alex
___
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] Dragging loads of sound files from libraryinto amovie clip

2009-04-09 Thread Muzak

I used to create loads of IDE Panels (SWF Panels) for Flash/Fireworks :)
You can even launch Fireworks from a swf and make it do all kinds of stuff (you can make RPC calls from a swf to Fireworks for 
instance).


About everything you do in Flash is done through jsfl.
Just open up the History panel and do some stuff and then copy it from the 
history panel to notepad to see what it looks like.

There used to be a complete Flash/Fireworks API for AS2 (or even AS1) but I'm 
not sure if that has been updated for CS4.
Flash panels are still pretty much alive (and now even work for Photoshop if 
I'm not mistaken).
Since I hardly ever use Flash nowadays I haven't looked into it much.

Just did a quick google and looks like CS4 still uses the same (or similar) API.

Flash CS4 jsfl docs:
http://help.adobe.com/en_US/Flash/10.0_ExtendingFlash/

Fireworks CS4 jsfl docs:
http://help.adobe.com/en_US/Fireworks/10.0_Extending/

Fireworks CS4: Cross-Product Extensions
http://help.adobe.com/en_US/Fireworks/10.0_Extending/WS5b3ccc516d4fbf351e63e3d1183c949219-8000.html

Fireworks CS4: Using the API wrapper extension in Adobe Flash
http://help.adobe.com/en_US/Fireworks/10.0_Extending/WS5b3ccc516d4fbf351e63e3d1183c949219-7fc8.html

regards,
Muzak

- Original Message - 
From: "Karl DeSaulniers" 

To: "Flash Coders List" 
Sent: Thursday, April 09, 2009 6:10 PM
Subject: Re: [Flashcoders] Dragging loads of sound files from libraryinto 
amovie clip



I must say WOW as well. I never knew you could do that eigther.

Karl

Sent from losPhone

On Apr 9, 2009, at 10:15 AM, "Paul Steven"   wrote:


Wow this jsfl is a life saver! Can't believe I had never heard about  it
before in all the years I have been using Flash.

Thank you Muzak for taking the time to write the code out for me. It  works a
dream!

Cheers

Paul



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


Re: [Flashcoders] rotationX not working In Flex actionscript Projects

2009-04-11 Thread Muzak
In FlexBuilder, in the Project properties (right click the project select properties), set the required Flash Player to 10 in the 
Flex Compiler tab.

By default FlexBuilder compiles to Flash 9, which doesn't have the new 3D stuff.

regards,
Muzak

- Original Message - 
From: "Omar Fouad" 

To: "Flash Coders List" 
Sent: Saturday, April 11, 2009 10:51 PM
Subject: [Flashcoders] rotationX not working In Flex actionscript Projects


Hi all,

Since I switched to Mac now, I am using Flex Builder for my ActionScript
Projects, I've got the latest Flex SDK 3.2 (I think that is the latest) and
edited the flex_config xml file. I've added the playerglobal swc file to the
build path of Flex for Auto Completion and all.

Here is the problem: it seems that the specific FP 10 new properties as .z,
.rotationX, .rotationY and .rotationZ are not recognized by the compiler.

mc.rotationX = 45; // this is not working as it is ignored.

Using Tweener:
Tweener.addTween(mc, { rotationX:45, time:1}); // throws "Property rotationX
not found on [object name ]  and there is no default value"

Is there anything wrong I am doing in flex?

Thanks for the support.

Cordially.

--
Omar M. Fouad - Adobe Flashâ„¢ Platform Developer
www.omar-fouad.net
Cellular: (+20) 1011.88.534
Mail: m...@omar-fouad.net


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


Re: [Flashcoders] rotationX not working In Flex actionscript Projects

2009-04-14 Thread Muzak

Well, that's the one you should enable :)
I don't know how else to *force* FlexBuilder to compile a f10 swf.

Try enabling it, fill in fp 10, then click "apply" (it will make some project changes behind the scene) then disable it again 
(leaving fp10 as the required version).

See if that helps..

regards,
Muzak

- Original Message - 
From: "Omar Fouad" 

To: "Flash Coders List" 
Sent: Tuesday, April 14, 2009 1:42 PM
Subject: Re: [Flashcoders] rotationX not working In Flex actionscript Projects


There is no compiler settings except to the html wrapper file that I don't
use...

On Sun, Apr 12, 2009 at 2:29 AM, Muzak  wrote:


In FlexBuilder, in the Project properties (right click the project select
properties), set the required Flash Player to 10 in the Flex Compiler tab.
By default FlexBuilder compiles to Flash 9, which doesn't have the new 3D
stuff.

regards,
Muzak



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


Re: [Flashcoders] rotationX not working In Flex actionscript Projects

2009-04-14 Thread Muzak

This might do the trick as well:

In the project properties select Flex Build Path -> Library Path.
Select the playerglobal.swc and remove it.
Select "Add SWC.." and browse to frameworks/libs/player/10/playerglobal.swc 
inside the 3.2 SDK directory and click OK.

That's probably what FB automatically does when you change the required FP 
version :)

regards,
Muzak

- Original Message - 
From: "Omar Fouad" 

To: "Flash Coders List" 
Sent: Tuesday, April 14, 2009 1:42 PM
Subject: Re: [Flashcoders] rotationX not working In Flex actionscript Projects


There is no compiler settings except to the html wrapper file that I don't
use...

On Sun, Apr 12, 2009 at 2:29 AM, Muzak  wrote:


In FlexBuilder, in the Project properties (right click the project select
properties), set the required Flash Player to 10 in the Flex Compiler tab.
By default FlexBuilder compiles to Flash 9, which doesn't have the new 3D
stuff.

regards,
Muzak

- Original Message - From: "Omar Fouad" 
To: "Flash Coders List" 
Sent: Saturday, April 11, 2009 10:51 PM
Subject: [Flashcoders] rotationX not working In Flex actionscript Projects


Hi all,

Since I switched to Mac now, I am using Flex Builder for my ActionScript
Projects, I've got the latest Flex SDK 3.2 (I think that is the latest) and
edited the flex_config xml file. I've added the playerglobal swc file to
the
build path of Flex for Auto Completion and all.

Here is the problem: it seems that the specific FP 10 new properties as .z,
.rotationX, .rotationY and .rotationZ are not recognized by the compiler.

mc.rotationX = 45; // this is not working as it is ignored.

Using Tweener:
Tweener.addTween(mc, { rotationX:45, time:1}); // throws "Property
rotationX
not found on [object name ]  and there is no default value"

Is there anything wrong I am doing in flex?

Thanks for the support.

Cordially.

--
Omar M. Fouad - Adobe Flashâ„¢ Platform Developer
www.omar-fouad.net
Cellular: (+20) 1011.88.534
Mail: m...@omar-fouad.net


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





--
Omar M. Fouad - Adobe Flashâ„¢ Platform Developer
www.omar-fouad.net
Cellular: (+20) 1011.88.534
Mail: m...@omar-fouad.net

This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be copied,
disclosed to, retained or used by, any other party. If you are not an
intended recipient then please promptly delete this e-mail and any
attachment and all copies and inform the sender. Thank you.
___
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] Nintedo experiencewii ( how did they do that ? )

2009-04-14 Thread Muzak

Stephen, I think the answer is one word: Money.



Well, not enough money apparently.. getting security errors and a bunch of "null 
object reference" errors :)


- Original Message - 
From: "jonathan howe" 

To: "Flash Coders List" 
Sent: Tuesday, April 14, 2009 7:15 PM
Subject: Re: [Flashcoders] Nintedo experiencewii ( how did they do that ? )



Stephen, I think the answer is one word: Money.

My theory is that the whole page is paid advertising.


On Tue, Apr 14, 2009 at 1:03 PM, Stephen Matthews wrote:


Hi,

I know that the whole YouTube area is a Flash movie, but...
does anyone have any idea how they got to embed this Flash movie onto the
YouTube site?

http://www.youtube.com/experiencewii

( I see the Flash movie is served from the facebook.com server - even
weirder ).

Regards - and thanks

Steve


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


Re: [Flashcoders] Favorite Flex book?

2009-04-14 Thread Muzak

I have
Flexbuilder but don't use it much because I have so many out of memory
errors with it, I haven't been able to get those under control - only
happens with Flexbuilder - not with any other multimedia application.


Sounds odd. 
I've used FB on an older P4 with only 1Gb ram without any problems.


As Dave said, you should probably look into tweaking the Eclipse JVM memory 
If you google "Eclipse JVM" or "Eclipse ini" I'm sure something useful will come up.


Here's an article on EclipseZone:
http://eclipsezone.com/eclipse/forums/t61618.html

As for Flex books, I never looked into any of them.
There's plenty of things to get you started on the Adobe site:
http://www.adobe.com/devnet/flex/?tab:samples=1
http://www.adobe.com/devnet/flex/quickstart.html

And I spend alot of time reading docs :)
http://livedocs.adobe.com/flex/3/html/help.html?content=Part2_DevApps_1.html
pdf of the above: http://livedocs.adobe.com/flex/3/devguide_flex3.pdf
http://livedocs.adobe.com/flex/3/langref/index.html

regards,
Muzak

- Original Message - 
From: "Merrill, Jason" 

To: "Flash Coders List" 
Sent: Tuesday, April 14, 2009 8:06 PM
Subject: RE: [Flashcoders] Favorite Flex book?



(On a side note, are there people out there who are successfully using
FlashDevelop with the FlexDesignView plugin for real development? Or

should

I lay down the cash for FlexBuilder?)


I'm using FlashDevelop + the free Flex SDK from Adobe to create Flex
apps.  Works great, no problems.  I didn't know about the FlexDesignView
plugin until you mentioned it!  My only problem with using the Flex SDK
this way is it doesn't include the charting components.  I have
Flexbuilder but don't use it much because I have so many out of memory
errors with it, I haven't been able to get those under control - only
happens with Flexbuilder - not with any other multimedia application.
And I have 2GB RAM.  I'm really disappointed in Adobe for not addressing
this issue - but sorry, back to your topic:

To fit your description, I like the Flex 3 Cookbook from O'Reilly press
- though I does not compare Flash and Flex if that is what you are
looking for.  It's just filled with tons of examples on how you would
solve specific problems with Flex: 


http://www.amazon.com/dp/0596529856/?tag=googhydr-20&hvadid=3383658585&r
ef=pd_sl_74cudeesgv_e

For training, I like the Adobe Flex training from the source book(s). I
have the one for Flex 2, but here is the latest:

http://www.amazon.com/Adobe-Flex-3-Training-Source/dp/0321529189/ref=sr_
1_1?ie=UTF8&s=books&qid=1239732077&sr=1-1

Some people like the Friends of Ed books too - I have some of those and
they are great, but they are for Actionscript 3 and design patterns, not
Flex.  The Friends of Ed books on Flex are probably pretty good too.


Jason Merrill 



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


Re: [Flashcoders] Favorite Flex book?

2009-04-14 Thread Muzak

If you're using the Flex Builder integrated install


What does that mean?  How would I know?


Flex Builder Standalone
vs
Eclipse + FB plugin.

If you have FB standalone, you typically see the FB startup logo when starting 
the app.
Eclipse + FB plugin shows the Eclipse logo at startup.

The standalone version has Eclipse integrated, so it installs Eclipse for you 
(kinda).
With this config you'll have 1 install directory (e.g. "C:\Program Files\Adobe\Flex 
Builder 3")

The plugin version requires Eclipse to be already installed and during the FB 
plugin installation asks for the Eclipse location.
With this config you'll have 2 install locations: e.g. "C:\Eclipse" (or whereever you installed Eclipse) + "C:\Program 
Files\Adobe\Flex Builder 3 plugin"


regards,
Muzak

- Original Message - 
From: "Merrill, Jason" 

To: "Flash Coders List" 
Sent: Wednesday, April 15, 2009 1:10 AM
Subject: RE: [Flashcoders] Favorite Flex book?



As Dave said, you should probably look into tweaking the Eclipse JVM

memory If you google "Eclipse JVM" or "Eclipse ini" I'm sure something
useful will come up.

Dave, Muzak -

Hey thanks guys.  However, been there and done that tweaking of the ini
a few times to create more heap space. Initally, I discovered the
problem was the ini file was actually MISSING from my
Flexbuilder/Eclipse install (after my license was purchased, it was
pushed to my machine via Tivoli - I'm sure that's what caused the
problem - the person who packed it in Tivoli probably did it wrong), so
I had to manually create it with notepad and then tweak the settings as
per what people on the Flexcoders list advised and also tried things in
articles.  Thanks though.  The version of Eclipse is just what came out
of the box from Adobe, so it should work.  However, I may try
re-installing that too.  I wonder if there are any other files missing -
Flexbuilder works fine with otherwise.

I had not seen that article before in my research Muzak, thanks!  I'll
try that out.  This experience has made me really dislike the fact that
Adobe essentially built an Eclipse Plug-in instead of a single app, but
I also understand why they did it.  It makes it difficult to know what
to tweak, where to tweak it,etc.  And also trying to explain this to the
guy creating the Tivoli push was pretty hard - he didn't get the concept
too well, which is I'm sure what started the problem in the first place
when it wasn't packaged right.


If you're using the Flex Builder integrated install


What does that mean?  How would I know?  Thanks.


Jason Merrill


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


Re: [Flashcoders] Favorite Flex book?

2009-04-14 Thread Muzak

No, this is actually a Good Thing(tm). Eclipse is a mature environment
with lots of people improving it regularly. And because of its plugin
architecture, you can use it for all sorts of things.


Not to mention a big step forward from Flex 1/1.5 which was a messed up version 
of Dreamweaver.

I have 2 installs:
- FlexBuilder + Subclipse (with integrated Eclipse updated to 3.3)
- Eclipse (Ganymede 3.4 http://www.eclipse.org/ganymede/) + FDT + CFEclipse + 
EclipseNSIS + Subclipse (and a few others)

Why? 
Well Flex Builder standalone can be updated (the Eclipse part) but not to the latest version (3.4). 
Updating Eclipse to 3.3 is fine though. 


The latest CFEclipse plugin requires Eclipse 3.4 so I installed Eclipse 
separatly for that :)

regards,
Muzak

- Original Message - 
From: "Dave Watts" 

To: "Flash Coders List" 
Sent: Wednesday, April 15, 2009 2:47 AM
Subject: Re: [Flashcoders] Favorite Flex book?



This experience has made me really dislike the fact that Adobe essentially
built an Eclipse Plug-in instead of a single app, but I also understand why
they did it


No, this is actually a Good Thing(tm). Eclipse is a mature environment
with lots of people improving it regularly. And because of its plugin
architecture, you can use it for all sorts of things. For example, my
Eclipse install includes FlexBuilder, J2EE toolchain, CFEclipse,
Oxygen, Aptana, etc. And there are lots of third-party tools to help
manage Eclipse and plugin updates.


> If you're using the Flex Builder integrated install

What does that mean? How would I know? Thanks.


You can either install Flex Builder with Eclipse, or into an existing
Eclipse install. The version of Eclipse that comes with Flex Builder
is not the latest version - if I recall correctly, it's 3.2.

To find out which you have, the integrated Flex Builder/Eclipse is
installed in c:\program files\adobe, while if you installed Eclipse
separately, it'd be wherever you put it - typically, c:\eclipse. Also,
you get different splash screens.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!

___
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] Just a quick one

2009-04-18 Thread Muzak
IMHO they should have just integrated all the code editing and 
compilation abilities into dreamweaver to make it a better, must have, 
product, or put everything dreamweaver has into eclipse if they truly 
want to move everything to eclipse.


They (Macromedia) tried that with Flex 1 and 1.5 and failed miserably.
If you think Eclipse is slow (which I don't) then you should find a copy of 
Flex 1 :)

Like Dave I have also run Eclipse on a single core P4 with 1Gb ram and it ran 
OK.
Took a bit of jvm tweaking though. And FB 3 runs alot better than FB2.

On a dual core 3.0 with 4Gb ram it runs smooth as butter.

I'm personally very happy with FlexBuilder (and Eclipse in general) and look 
forward to Bolt (CF editor).

regards,
Muzak

- Original Message - 
From: "Anthony Pace" 

To: "Flash Coders List" 
Sent: Saturday, April 18, 2009 8:55 PM
Subject: Re: [Flashcoders] Just a quick one



Use Flash Develop or Flex Builder

Flash develop is free and great for as3; yet, Flex Builder for eclipse, 
with its insanely high price tag of $249, is better if you want to 
include capabilities to edit other languages like c++ or java.


IMHO they should have just integrated all the code editing and 
compilation abilities into dreamweaver to make it a better, must have, 
product, or put everything dreamweaver has into eclipse if they truly 
want to move everything to eclipse.


Eclipse is insanely slow, and java , even with flashdevelop's sytax 
checking through java, makes my dual core 2.2 ghz CPU with 2gigs of 
memory, spike at 45% for its processes and take 250 - 500 MB of memory.  
Java sucks ass when it comes to speed; despite the propaganda, spread by 
SUN and java developers, to the contrary.





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


Re: [Flashcoders] Just a quick one

2009-04-18 Thread Muzak

This should work:

import ImageLoader;

var imgHolder:MovieClip = this.createEmptyMovieClip("imgHolder_mc", 
this.getNextHighestDepth());
var imgURL:String = "ableton_live6_logo.jpg";
var imgLoader:ImageLoader;

function onLoadInit():Void {
trace("Application ::: onLoadInit");
trace("- width: " + imgHolder._width);
trace("- height: " + imgHolder._height);
}

imgLoader = new ImageLoader();
imgLoader.addListener(this);
imgLoader.loadImage(imgURL, imgHolder);

regards,
Muzak

- Original Message - 
From: "Karl DeSaulniers" 

To: "Flash Coders List" 
Sent: Sunday, April 19, 2009 12:56 AM
Subject: Re: [Flashcoders] Just a quick one


Thank you all for the great responses. I actually think I have a copy  
of flex 1 somewhere. LOL


But alas my movie is still not working and my programming knowledge  
extent at this time is as2 based. Don't seem to get the time to dive  
into as3 or any other ie: flex 1


I really am stumped on how to get the w&h of this loaded data. Nothing  
I do seems to work.


:(



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


Re: [Flashcoders] Flash Player 6 Cross Domain Policy

2009-04-21 Thread Muzak

It appears that the cross domain policy files were not introduced until
Flash Player 7 - is this correct?


Nope, Flash Player 6,0,21,0.

Check out the Adobe Security Center:
http://www.adobe.com/devnet/security/

http://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html#flash-player-support-by-version


- Original Message - 
From: "Paul Steven" 

To: "'Flash Coders List'" 
Sent: Tuesday, April 21, 2009 1:15 PM
Subject: [Flashcoders] Flash Player 6 Cross Domain Policy



I need to confirm whether it is possible for a game being published for
Flash Player 6 and played with the Flash Player 6 plug-in is able to read
and write an xml file on another server?

It appears that the cross domain policy files were not introduced until
Flash Player 7 - is this correct?

Basically my client does not want to host the highscores on their server so
I am assessing whether I can host the swf on their server and update and
retrieve the high scores from my server using PHP and xml?

Any advice much appreciated on possible solutions

Paul

___
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] Loading string data in a file from a server

2009-04-21 Thread Muzak

Works fine here (Flex+Air).

- Original Message - 
From: "Sidney de Koning" 

To: "Flash Coders List" 
Sent: Tuesday, April 21, 2009 3:41 PM
Subject: Re: [Flashcoders] Loading string data in a file from a server



Anybody?

I just want to know how to load an file from a server that holds  
string data (xml or txt file) without getting the 2032 error.


Please help,

Sid


On Apr 20, 2009, at 4:14 PM, Sidney de Koning wrote:


Hi List,

I want to load textfile from my own server from an AIR app but i  
keep getting a 2032 Error, a Stream Error. Event though when i load  
this from the browser it works.
The docs about this on the net are very limited. This is what i  
thought of so far:


- It could be a crossdomain error?
- I do handle all events?
- I tried a loading in a PHP file that uses fopen to serve me the file

Do anyone have any ideas? I just want to read in this text file ( or  
any other file with string data from my server ) or should i use  
FileStream to read in the file? Eventually the contents of the file  
i load in will will need to be a File Object ().


Thanks in advance,

Sidney

Below is my code:


var xmlURL:String = "http://www.funky-monkey.nl/air/stringtest/serveFile.php 
";


var xmlReq:URLRequest = new URLRequest( xmlURL );
var xmlLoader:URLLoader = new URLLoader( xmlReq );

//listen for error events
xmlLoader.addEventListener( IOErrorEvent.IO_ERROR , onIOError );
xmlLoader.addEventListener( SecurityErrorEvent.SECURITY_ERROR ,  
onSecurityError );

xmlLoader.addEventListener( Event.COMPLETE , xmlLoaded );

function xmlLoaded(evt:Event):void {
trace( evt.target.data)
}

function onIOError(evt:IOErrorEvent):void {
trace( evt.text)
}

function onSecurityError(evt:SecurityErrorEvent):void {
trace( evt.text )
}




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


Re: [Flashcoders] Loading string data in a file from a server

2009-04-21 Thread Muzak

And when you trace out you do get the contents of the file?


Yup, I saw file content in debug window.


If it does work, my question becomes something different;
How do i convert the loaded in data (one big string) to a File object ?


Use xml instead of text?


- Can i add data to a File Object?
- Can i create a new temporary File Object and and string data to it?  


Nope and nope.
The data property of a File object is read only. Check the docs.
You typically use a File object in combination with a FileStream instance to 
read/write to disk.
http://livedocs.adobe.com/flex/3/langref/flash/filesystem/File.html
http://livedocs.adobe.com/flex/3/langref/flash/filesystem/FileStream.html


I save it in memory and pass it through to the rest.


Depends on what the "rest" is, but you can pass a File object around, just like 
any other object.

regards,
Muzak

- Original Message - 
From: "Sidney de Koning" 

To: "Flash Coders List" 
Sent: Tuesday, April 21, 2009 4:49 PM
Subject: Re: [Flashcoders] Loading string data in a file from a server



Hi Muzak,

And when you trace out you do get the contents of the file?

Sid



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


Re: [Flashcoders] Loading string data in a file from a server

2009-04-22 Thread Muzak

Well it depends on what you're trying to do with the loaded data.
If all you want is to load it and write to disk, then the format doesn't really 
matter.

As mentioned earlier, to write the loaded data to disk you use a combination of 
a File instance and a FileStream instance.
Should be examples of that in the docs.

http://help.adobe.com/en_US/AIR/1.5/devappshtml/WS5b3ccc516d4fbf351e63e3d118666ade46-7e4a.html

The following will load the data, when loaded, ask where to save it, and then 
write that data to the file you selected.

  private var plsData:String;

  private function appInit():void {
   trace("Application ::: appInit");
   var plsURL:String = 
"http://www.funky-monkey.nl/air/stringtest/serveFile.php";;
   var plsReq:URLRequest = new URLRequest( plsURL );
   var plsLoader:URLLoader = new URLLoader( plsReq );
   plsLoader.addEventListener( Event.COMPLETE , plsLoaded );
  }
  
  private function plsLoaded(evt:Event):void {

   trace("Application ::: plsLoaded");
   var value:String = plsData = evt.currentTarget.data;
   trace(value);
   var f:File = new File();
   f.addEventListener(Event.SELECT, fileSelectHandler);
   f.browseForSave("Save Data");
  }
  
  private function fileSelectHandler(evt:Event):void {

   trace("Application ::: fileSelectHandler");
   var f:File = evt.currentTarget as File;
   trace("- nativePath: ", f.nativePath);
   // create filestream, open it and write data to file
   var fs:FileStream = new FileStream();
   fs.open(f, FileMode.WRITE);
   fs.writeUTFBytes(plsData);
   fs.close();
  }


- Original Message - 
From: "Sidney de Koning" 

To: "Flash Coders List" 
Sent: Wednesday, April 22, 2009 9:44 AM
Subject: Re: [Flashcoders] Loading string data in a file from a server


No i cant use XML since eventually it will be a PLS file (Winamp  
Shoutcast), I wrote a library that parses a PLS file (Playlist file  
from Winamp Shoutcast server) (http://code.google.com/p/as3plsreader/)  
this all works fine from with AIR, IF I have the file already saved to  
local disk.


So my final test is to directly load the PLS from the shoutcast server.
That why i need to convert the event.target.data to a File... Cant i do:

var f:File = new File(event.target.data) ?

Do you have any other suggestion on how to do this?

Greets Sid




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


Re: [Flashcoders] Feasibility of xml file for high score data storage

2009-04-22 Thread Muzak

An xml "file" for use by multiple clients simultaneously is just not an option.
Go with a database + server side language (php, asp, coldfusion) and add 
remoting if you can.

regards,
Muzak

- Original Message - 
From: "Paul Steven" 

To: "'Flash Coders List'" 
Sent: Wednesday, April 22, 2009 12:57 PM
Subject: [Flashcoders] Feasibility of xml file for high score data storage



I was considering using an xml file to store high score data for a game. It
is quite possible that this game will have a significant amount of traffic
(certainly in the first few days after launch) and I am now wondering if an
xml file would be suitable. I am not sure what happens in the scenario where
multiple players want to update the highscore at the same time - they will
all need to write to the file. I assume this is the same scenario with a
database but think perhaps updating a database is more efficient.

Anyone care to offer any insight into whether an xml file would be suitable
or not? 


Thanks

Paul



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


Re: [Flashcoders] Loading string data in a file from a server

2009-04-22 Thread Muzak

Well that was just an example :)

Here's how to do it without the save file dialog:

  private function plsLoaded(evt:Event):void {
   trace("Application ::: plsLoaded");
   var value:String = evt.currentTarget.data;
   trace(value);
   var f:File = File.desktopDirectory;
   f.url += "/playlist.pls";
   trace("- url: ", f.url);
   trace("- nativePath: ", f.nativePath);
   var fs:FileStream = new FileStream();
   fs.open(f, FileMode.WRITE);
   fs.writeUTFBytes(plsData);
   fs.close();
  }

The above will create a file called "playlist.pls" on your desktop.

Some stuff on security:
http://help.adobe.com/en_US/AIR/1.5/devappshtml/WS5b3ccc516d4fbf351e63e3d118666ade46-7e5b.html
http://help.adobe.com/en_US/AIR/1.5/devappshtml/WS5b3ccc516d4fbf351e63e3d118666ade46-7e59.html


From the above:


AIR applications cannot modify content using the app: URL scheme.
Also, the application directory may be read only because of administrator 
settings.

Unless there are administrator restrictions to the user's computer, AIR applications are privileged to write to any location on the 
user's hard drive.

Developers are advised to use the app-storage:/ path for local storage related 
to their application.


To get to the application storage directory rather than the desktop, in the 
above example, use:
   var f:File = File.applicationStorageDirectory;

regards,
Muzak

- Original Message - 
From: "Sidney de Koning" 

To: "Flash Coders List" 
Sent: Wednesday, April 22, 2009 3:37 PM
Subject: Re: [Flashcoders] Loading string data in a file from a server



Hi Muzak,

This is not exactly what i want to do but it comes close (and i cant  test 
right now since i'm at work)
The whole 'prompt user for saving a file' i want to avoid, but the  below code 
looks like what i wan to do:


  var f:File = evt.currentTarget as File;
  trace("- nativePath: ", f.nativePath);
  // create filestream, open it and write data to file
  var fs:FileStream = new FileStream();
  fs.open(f, FileMode.WRITE);
  fs.writeUTFBytes(plsData);
  fs.close();


Thanks for the help, will let you know if it worked.

Sid




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


Re: [Flashcoders] Memory concerns

2009-04-28 Thread Muzak

If you have many listeners in a loaded external movie and then you remove
the movie are the listeners still in memory, which might cause problems
later?


Yes.



AFAIK, that's a "No". If there are no more references *to* the external movie, 
you should be fine.
There are problems however with external movies having NetConnection, NetStream 
and Sound objects.
For that, a new method was introduced:

Loader.unloadAndStop();

Have a look at Loader.unload() and loader.unloadAndStop()

http://livedocs.adobe.com/flex/3/langref/flash/display/Loader.html#unload()
http://livedocs.adobe.com/flex/3/langref/flash/display/Loader.html#unloadAndStop()


- Original Message - 
From: "Paul Andrews" 

To: "Flash Coders List" 
Sent: Tuesday, April 28, 2009 7:55 PM
Subject: Re: [Flashcoders] Memory concerns


- Original Message - 
From: "John R. Sweeney Jr" 

To: "Flash Coders List" 
Sent: Tuesday, April 28, 2009 6:35 PM
Subject: [Flashcoders] Memory concerns



I know you have to implicitly remove objects to free up memory, but does
that also apply to listeners?


Yes.



If you have many listeners in a loaded external movie and then you remove
the movie are the listeners still in memory, which might cause problems
later?


Yes.


Thanks in advance for any insights,
John


Anything with a reference to it won't be garbage collected and that includes 
listeners and instances referenced by listeners (unless it's a weak 
reference).


Paul 



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


Re: [Flashcoders] Memory concerns

2009-04-28 Thread Muzak
So, you may be right but I'm not entirely convined about unload() sorting 
out event handlers.


Well there's nothing to sort out if the external content only has events going 
on inside itself.

- Original Message - 
From: "Paul Andrews" 

To: "Flash Coders List" 
Sent: Wednesday, April 29, 2009 2:11 AM
Subject: Re: [Flashcoders] Memory concerns




- Original Message - 
From: "Muzak" 

To: "Flash Coders List" 
Sent: Tuesday, April 28, 2009 7:46 PM
Subject: Re: [Flashcoders] Memory concerns


If you have many listeners in a loaded external movie and then you 
remove

the movie are the listeners still in memory, which might cause problems
later?


Yes.



AFAIK, that's a "No". If there are no more references *to* the external 
movie, you should be fine.


I'm not sure that's true for Loader.unload() and event handlers..

There are problems however with external movies having NetConnection, 
NetStream and Sound objects.

For that, a new method was introduced:


Interestingly enough this method explicitly deals with event dispatchers and 
is only available in FP10.


So, you may be right but I'm not entirely convined about unload() sorting 
out event handlers.


Paul



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


Re: [Flashcoders] mxmlc include classes , possible???

2009-04-29 Thread Muzak

Checked the docs?

includes class [...] 
Links one or more classes to the resulting application SWF file, whether or not those classes are required at compile time.


http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_14.html


- Original Message - 
From: "Jiri" 

To: "Flash Coders List" 
Sent: Wednesday, April 29, 2009 4:40 PM
Subject: [Flashcoders] mxmlc include classes , possible???



Hello list,

Is it possible to force the mxmlc compiler to include certain classes so 
they can be instantiated at runtime. So I dont have to put an explicit 
reference in the .as files, in order to include it.


I thought there was a compiler flag called include-classes, but a google 
search yields nothing of any use.


I tried putting this in my flex-config


org.name.class
  

But I get an error.

Doing a mxmlc -help advanced in the console also yields no such flag.

So I wonder now, is it at all possible, or do i need to create a .swc 
and have that add to the librart tag?


Jiri



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


Re: [Flashcoders] Batch wrapping a bunch of FLV files in SWFs

2009-04-30 Thread Muzak

You know you can control flv's right?

- Original Message - 
From: "Henry Cooke" 

To: "Flash Coders List" 
Sent: Thursday, April 30, 2009 7:23 PM
Subject: [Flashcoders] Batch wrapping a bunch of FLV files in SWFs



Anyone know a good way of doing this?
I've got a big stack of FLVs that I need to wrap up in SWFs so I can control
their timelines properly.

I'd love it if there was a command line tool like swfmill or  swftools to do
it, but I'm willing to try anything that works ;)

h.


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


Re: [Flashcoders] E4X question

2009-04-30 Thread Muzak

var floorplan:XML = 

 
 


 
 


 
 


 
 

;

var dep:String = "Reception";

trace("floor: ", floorplan.floor.dept.(@name == dep).parent().toXMLString());

//output:
floor:  
 
 


Is that what you're looking for?

regards,
Muzak

- Original Message - 
From: "Mendelsohn, Michael" 

To: "Flash Coders List" 
Sent: Thursday, April 30, 2009 8:43 PM
Subject: [Flashcoders] E4X question



Hi list...

I'm still relatively new with E4X.  I can't get seem to get this function to return the name of the floor that the department is 
on.  I.E., pass a string, traverse the xml, get the parent's name attribute.  In my second attempt, I figured to test for the 
property name first, because the root node doesn't have @name, but still no luck.  This should be easy, right?  It's probably 
obvious.


Thanks,
- Michael M.

private function getFloor(deptName:String):void{
// always errors
var theFilteredList:XMLList = FloorplanData..*.(@name==thisLabel);
// this doesn't work either
var f:XMLList = FloorplanData.*.(hasOwnProperty("name") && 
attribute("name")==thisLabel);
}






















___
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] Dynamic Images and the Library

2009-05-02 Thread Muzak

Google for JPEGEncoder and/or PNGEncoder.

- Original Message - 
From: "Karl DeSaulniers" 

To: "Flash Coders List" 
Sent: Sunday, May 03, 2009 5:30 AM
Subject: Re: [Flashcoders] Dynamic Images and the Library



Thanks Ashim. I will try that.

Sent from losPhone

On May 2, 2009, at 10:06 PM, "Ashim D'Silva"  
 wrote:



If you're dynamically loading an image, it doesn't have to be an mc,
it's bitmap data and can be treated so.

If you want to save the contents of an mc to an image, use
bitmapData.draw(mc) to get bitmapData and write that to a jpeg/png on
your server. You should be able to find a tutorial that runs you
through the whole process.

Ashim

The Random Lines
My online portfolio
www.therandomlines.com





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


Re: [Flashcoders] What's the dollar symbol for?

2009-05-05 Thread Muzak

What does the dollar symbol do?


It shows that the developer broke the underscore key on his keyboard :)
And that he's most likely a PHP developer.. or both.

gd$rating --> gdRating --> gd_rating

And I assume "gd" stands for Google Data --> Google Data API
http://code.google.com/intl/nl-BE/apis/gdata/overview.html

gd is also a namespace in the GData XML in the YouTube Data API
http://code.google.com/intl/nl-BE/apis/youtube/2.0/reference.html#GData_elements_reference


- Original Message - 
From: "Stephen Matthews" 

To: 
Sent: Tuesday, May 05, 2009 10:42 AM
Subject: [Flashcoders] What's the dollar symbol for?


Hi, I am working with Martin Legris's great Youtube API class and  
wondered what this was

( _data.gd$rating )
What does the dollar symbol do?
Here is a link to the particular class-
http://as3-youtube-data-api.googlecode.com/svn/trunk/ca/newcommerce/youtube/data/VideoData.as
This is the getter-
public function get rating():RatingData
{
return new RatingData(_data.gd$rating);
}

PS I looked at Adobe's online help but could not find a reference to it.
Thanks Steve


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


Re: [Flashcoders] What's the dollar symbol for?

2009-05-05 Thread Muzak

Not really..
The guidelines specify to "prepend" a getter/setter with a dollar sign if it 
overrides an inherited getter/setter.


If a class overrides a getter/setter and wants to continue to expose the base getter/setter, it should do so by implementing a 
property whose name is the base name with a $ prepended. This getter/setter should be marked final and should do nothing more than 
call the supergetter/setter.



gd$comments
gd$rating
gd$feedLink

AFAIK, those have nothing to do with that.
If they did, they would be:

$gdComments
$gdRating
$gdFeedLink

indicating overriding inherited properties: gdComments, gdRating, gdFeedLink

Again, my guess is they want to indicate they represent the GData API xml ellements which 
use the "gd" namespace.
http://code.google.com/intl/nl-BE/apis/youtube/2.0/reference.html#GData_elements_reference

I haven't looked at the YouTube API at all by the way, so I'm just guessing :)

regards,
Muzak

- Original Message - 
From: "Ivan Dembicki" 

To: "Flash Coders List" 
Sent: Tuesday, May 05, 2009 1:35 PM
Subject: Re: [Flashcoders] What's the dollar symbol for?



Hello,

http://opensource.adobe.com/wiki/display/flexsdk/Coding+Conventions#CodingConventions-Property(variableandgetter%2Fsetter)names

and you can find other $ symbols in this document.

--


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


Re: [Flashcoders] Re: CS4 on non intel

2009-05-05 Thread Muzak

I've used FontExpert in the past.
Great tool for managing installed and non-installed fonts.
Also allows you to temporarily deactivate installed fonts and alot more..
http://www.proximasoftware.com/fontexpert/


- Original Message - 
From: "Glen Pike" 

To: ; "Flash Coders List" 

Sent: Wednesday, May 06, 2009 12:39 AM
Subject: Re: [Flashcoders] Re: CS4 on non intel



Hi,

   Is there any way of "testing" the validity of fonts on PC's?

   I ask as we have a similar problem with Adobe Premiere Pro 2 where 
fonts are causing the program to crash...  Not sure how you "validate" 
on a Mac, but if there is some kind of tool to do this...


   Googling shows what looks like a lot of complaints about Adobe stuff 
suffering from "dodgy font" crashes - it seems ironic that a company 
dealing mainly in graphics software can't seem to write a program that 
fails gracefully when something graphical goes wrong ;|


   Any tips on fonts are most appreciated as we have about 700 or more 
installed (and never used...)


   Glen



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


Re: [Flashcoders] RegEx

2009-05-09 Thread Muzak

Must be a mistake. There's no such mention here:
http://livedocs.adobe.com/flex/3/langref/String.html#match()

- Original Message - 
From: "Anthony Pace" 

To: "Flash Coders List" 
Sent: Sunday, May 10, 2009 12:54 AM
Subject: [Flashcoders] RegEx


I am reading the documentation, and it says that match and replace are 
only for air 1.0 and they have that nasty trilobal air logo.


What the heck  If that is the case then why are they running in the 
flash player?


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


Re: [Flashcoders] Projector "Serial Number" protection

2009-05-26 Thread Muzak

Careful with buying Zinc if you don't already have a license.
As of late, their support is non existing. They haven't responded in quite some 
time on their support forums.
I've asked them (a month ago) about a (serious) bug that has been around since 
August 2008 and haven't heard anything.

Just a friendly warning :)

- Original Message - 
From: "Glen Pike" 

To: "Flash Coders List" 
Sent: Wednesday, May 27, 2009 12:22 AM
Subject: Re: [Flashcoders] Projector "Serial Number" protection



Hi,

   Cheers guys - Zinc looks quite sturdy and possibly a nice 
investment, depending on whether the (humanoid) client wants to go for 
something flexible.


   Found a few other products that let you bundle in serial protection 
- probably less flexible, but cheap - links for anyone interested.  
Comments welcome..
  
   http://www.increditools.com/flash_exe_builder/features.php

   http://www.chameleonflash.com/index.html

   As for the robots - they can look after themselves - can't put 
serial numbering on an OS Linux app, so we have to resort to making the 
robots walk and fight their own battles :P


   Later

   Glen



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


Re: [Flashcoders] blip.tv api?

2009-06-19 Thread Muzak

Their API is explained here:
http://wiki.blip.tv/index.php/Blip.tv_API

username and password are in the prompt.


- Original Message - 
From: "Nate Beck" 

To: "Flash Coders List" 
Sent: Friday, June 19, 2009 5:17 AM
Subject: Re: [Flashcoders] blip.tv api?



To try and make this a little more clear.  You're basically requesting
the information from their webservers using a customized url.

A RESTful service you can actually use from a web browser, for
example... on Twitter Search you can get your results in JSON by doing
this.

http://search.twitter.com/search?q=iPhone

turns into this:

http://search.twitter.com/search.json?q=iPhone

Which will return the data your looking for in a format called JSON
(JavaScript Object Notation).

So to clarify on what I said earlier.  You can get this data into your
flash application using URLLoader.  Just set the URL to where the JSON
data is and then request it.

When you get a result back, you will have a REALLY long String of data
that you want to drill into. That's where as3corelib and it's
JSON.parse() method steps in. You pass JSON.parse() a String and it
returns an Object.

You can then drill into that Object to get the relevant data that you need.

Those Java and Ruby files are just wrappers for making calls to
Blip.tv web services.  Unfortunately there isn't a wrapper (library)
for ActionScript.

Hopefully that makes it a bit more clear, I wasn't trying to be rude
earlier, after re-reading my emails I may have come across that way.
I apologize.

Cheers,
Nate



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


Re: [Flashcoders] blip.tv api?

2009-06-19 Thread Muzak

You're not limited to JSON.

From what I can tell (only looked at their API real quick), blip.tv supports 
JSON, REST and RSS (xml).


Which one you use is up to you (you can even mix them if you want).

regards,
Muzak

- Original Message - 
From: "Fabio Pinatti" 

To: "Flash Coders List" 
Sent: Friday, June 19, 2009 1:55 PM
Subject: Re: [Flashcoders] blip.tv api?



hello!

@Nate: Thank you so much by the so clear explanation.. I don't have much
experience with JSON and that's why I didn't get it if blip.tv was possible
through flash.. but your last emails were great, and a great step to learn
it.. About google, well, I really agree with you that it needs to be the
first tool to everyone, since a lot of people are really lazy.. the point is
that I didn't get the files and process to do in my case, and that's why
I've posted in that forum.. thank you so much, Nate!

@Muzak: I saw that they require a login/pass, and now I know that can be
possible use the api from flash, I'll dig for register and get a login info
to me and check it better right now.. thanks Muzak!



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


Re: [Flashcoders] Flex interferes with SVN

2009-06-26 Thread Muzak

I use SubClipse and TortoiseSVN and have no problems.
Just make sure both have the exact same version, 1.6.2 in my case.

regards,
Muzak

- Original Message - 
From: "Mario Gonzalez" 
To: "Flash Coders List" ; "This is the generalmailing list for FlashCodersNY.org" 


Sent: Saturday, June 27, 2009 12:00 AM
Subject: [Flashcoders] Flex interferes with SVN


If I have a project that is under subversion control, then I decide to make a flex project with the folder (order of these two 
operations can be reversed with same results) everything gets screwed up.
I can't add/commit (* is already under version control) my files because flexbuilder already has it's own internal 'subversion' 
type system.


If you try to commit you get this error
Over all its a big annoying mess,

What do you guys do in this situation?


Mario Gonzalez
http://onedayitwillmake.com
Senior Developer | WDDG.com



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


Re: [Flashcoders] Youtube Videos cache

2009-06-28 Thread Muzak

And from what I can tell, doesn't work for HD videos, which is where this 
*feature* would actually be useful.

- Original Message - 
From: "Juan Pablo Califano" 

To: "Flash Coders List" 
Sent: Sunday, June 28, 2009 8:34 PM
Subject: Re: [Flashcoders] Youtube Videos cache



Appartently, the news is that it works across youtube CDN, which would
likely serve the same video from different servers / url.

Yet, I think calling this "incredible" is a bit overstated... And FWIW, it
doesn't seem to work every time (I've just tried it on Chrome -- default
settings -- and sometimes it works, sometimes it doesn't.


Cheers
Juan Pablo Califano

2009/6/28 Leandro Ferreira 


According to this site, Youtube can now cache his videos on the browser
"YouTube managed to achieve something incredible: browsers now cache
YouTube
videos and you can load the same video multiple times from the local cache.
" (
http://googlesystem.blogspot.com/2009/06/browsers-cache-youtube-videos.html
)
I though that FLV files were normally cached by the browser, but apparently
not.
Anyone got info about that?



 Leandro Ferreira


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


Re: [Flashcoders] Variable naming conventions...

2009-06-29 Thread Muzak

http://www.google.com/search?hl=en&q=as3+naming+conventions&meta=&aq=0&oq=as3+naming+con

http://opensource.adobe.com/wiki/display/flexsdk/Coding+Conventions

- Original Message - 
From: "Sander Schuurman" 

To: "Flash Coders List" 
Sent: Monday, June 29, 2009 1:34 PM
Subject: [Flashcoders] Variable naming conventions...



Hi,

just wondering what you guys have for variable naming conventions...

I use:

ALL_CAPITALS for constants
_underscore for private vars
this.thisPublicVar for public vars
$dollarSignedParam for method params
normalCamelCase for local method vars

Inside methods I can recognize all variable types...

What do you use?

Sander Schuurman
sentoplene.com
twitter: @sentoplene 
___

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] setTimeout / clearTimeout

2009-07-03 Thread Muzak

You may have to use _global.setTimeout() and _global.clearTimeout()

regards,
Muzak

- Original Message - 
From: "Glen Pike" 

To: "Flash Coders List" 
Sent: Friday, July 03, 2009 2:02 PM
Subject: [Flashcoders] setTimeout / clearTimeout



Hi,

   I have some old AS2 stuff where I have used setTimeout and 
clearTimeout in timeline script no problem, but as soon as I try to use 
these in a class I am getting compiler errors saying the functions are 
not defined.


   Any reason this would happen?  Compiling for Flash 8 AS2 with a 
mixture of timeline (yuck) and class code.


   Glen
___
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] Strange characters added to file when saving fromFlex/AIR using fileStream

2009-07-03 Thread Muzak

Use FileStream.writeUTFBytes()

   var xml:XML = 
 
 
 
burger
 3.95
 
 
 fries
 1.45
 
 ;

   var str:String = '' + File.lineEnding;
   str += xml.toXMLString();

   var fs:FileStream = new FileStream();
   fs.open(outputFile, FileMode.WRITE);
   fs.writeUTFBytes(str);
   fs.close();

regards,
Muzak

- Original Message - 
From: "Cheetham, Marcus" 

To: "Flash Coders List" 
Sent: Friday, July 03, 2009 12:39 PM
Subject: [Flashcoders] Strange characters added to file when saving 
fromFlex/AIR using fileStream



I'm using fileStream to save a text file. This works OK, but introduces
some strange characters at the beginning of the saved text.
I'm saving XML data. I've kept this as an XML object and also converted
it to string first -- same thing always happens.

Any idea how I can get rid of these characters?

Thanks, Marcus.

This is what I end up with (note the 'g at the beginning) :

'g
 
   burger
   3.95
 
 
   fries
   1.45
 


This is the Flex 3 code:

http://www.adobe.com/2006/mxml";
layout="absolute" activate="createXML()">














This email was sent by a company owned by Pearson plc, registered office at 80 
Strand, London WC2R 0RL.
Registered in England and Wales with company number 53723

___
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] Strange characters added to file whensaving fromFlex/AIR using fileStream

2009-07-03 Thread Muzak

You mean writing to disk?
That's AIR only.

regards,
Muzak

- Original Message - 
From: "Cor" 

To: "'Flash Coders List'" 
Sent: Friday, July 03, 2009 3:21 PM
Subject: RE: [Flashcoders] Strange characters added to file whensaving 
fromFlex/AIR using fileStream



Muzak,

Is this also possible from Flash??
And if so: How?

Kind regards
Cor

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com 
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Muzak
Sent: vrijdag 3 juli 2009 14:48
To: Flash Coders List
Subject: Re: [Flashcoders] Strange characters added to file when saving 
fromFlex/AIR using fileStream

Use FileStream.writeUTFBytes()

   var xml:XML = 
 
 
 
burger
 3.95
 
 
 fries
 1.45
 
 ;

   var str:String = '' + File.lineEnding;
   str += xml.toXMLString();

   var fs:FileStream = new FileStream();
   fs.open(outputFile, FileMode.WRITE);
   fs.writeUTFBytes(str);
   fs.close();

regards,
Muzak



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


Re: [Flashcoders] What program is this

2009-07-20 Thread Muzak

Have a look at Captivate:
http://www.adobe.com/products/captivate/


- Original Message - 
From: "Zuriel" 

To: 
Sent: Monday, July 20, 2009 11:57 PM
Subject: [Flashcoders] What program is this





Can someone tell me what this company used to record this demo? Was it all
done by hand with Flash or was a screen recording system used...

http://www.imagenow.com/interactive/demo-player.jsp?DemoPlayerFile=DemoPlayer_v03&File=ap-auto-invoice.swf&Title=ImageNow%20for%20Automated%20Invoice%20Processing&Copyright=%a9%202009%20Perceptive%20Software,%20Inc&KeepThis=true&TB_iframe=true&height=755&width=970
[1]

I am going to do one for a company and I was originally going to do it by
hand.. but it looks almost like its a FLV. with a player playing it??? can
someone tell me which one it is... I know of camtasia and random google
searches but which one is the best and which one is the most feature
packed.. I can code very good AS3 code ATM so I want one that maybe
integrates into Flash AS nicely..


Thanks!

Links:


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


Re: [Flashcoders] Image loader problem

2009-07-25 Thread Muzak

You don't need an array of urls, as you have no use for them,
you need an array of loader instances,
so that you have the correct order (as they are in the xml).

With e4x getting to the image urls is easy, and looping through them as well, so there really is no need to have them in a seperate 
array.


Something like this (from the top of my head):

private var data:XML = 



;

private var imgLoaders:Array;
private var numLoaded:int = 0;
private var numTotal:int;

function loadImages():void {
   imgLoaders = new Array();
   var imgs:XMLList = data.img;
   var len:int = numTotal = imgs.length();
   var loader:Loader;
   for(var i:int=0; iWith the above it doesn't matter in what order the images finish loading, you have the correct order in the array (imgLoaders) and 
you know when all images are loaded when numLoaded equals numTotal.


regards,
Muzak

- Original Message - 
From: "Paul Andrews" 

To: "Flash Coders List" 
Sent: Saturday, July 25, 2009 9:42 PM
Subject: Re: [Flashcoders] Image loader problem



Cor wrote:

Joseph,

I always like to write all the code myself. :-)
But I will look at this to learn from at least and maybe using someone else
his classes.

Thank you very much!!

Cor

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Joseph
Masoud
Sent: zaterdag 25 juli 2009 15:04
To: Flash Coders List
Subject: Re: [Flashcoders] Image loader problem

Have you considered using existing bulk loaders?
http://code.google.com/p/bulk-loader/

You've got a relatively complex task ahead if you're going to write  the code 
all by yourself.

Essentially the idea is to have two stacks, a loading stack and a  pending stack [list of assets to be loaded].  Ensure there is 
only one  loader in the loading stack at any time during the loading process if  order is important.


I suggest creating a separate data type for storing information about  the images, however I think you might want to consider 
letting one  object deal with the loading process.


Many thanks,
Joseph

On 25 Jul 2009, at 13:53, Cor wrote:



To solve your issue you might write the code so that the next image in
the sequence doesn't load
or start to load until the previous is complete.

Yes, but I dont know how.

You could bulk load the images and stuff them in an array then use a  loop to
run through
the array to get the image and it's properties so that you can align
everything the way you want.

Frankly I just want them in the same order as they are in my xml.


Here's a nudge in the right direction. Store the image paths in an array - imagePaths and the loaded images in loadedImages. Use i 
as a counter through the array. I have ommited variable declarations. This is just a bare bones, with bits missing! Adapt to your 
case.


Paul

function loadImage():void
{
if ((i= 0))
{
loader =new flash.display.Loader();
urlreq = new URLRequest(imagePaths [i]);

loader .contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
loader .contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,onIOError);
loader .load(urlreq);
}
}

public function _onLoadComplete(e:Event):void {
loadedImages[i]= e.currentTarget.content;
i++;
if (i

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


Re: [Flashcoders] Image loader problem

2009-07-26 Thread Muzak

When you get a elements from an XML object through e4x it return an XMLList.

The following would throw an error:

var data:XML = 



;

var imgs:XML = data.img;

//output:
TypeError: Error #1034: Type Coercion failed: cannot convert xmll...@4a24d91 to 
XML.


The following works:

var data:XML = 



;

var imgs:XMLList = data.img;

trace("num nodes: ", imgs.length());
trace(imgs.toXMLString());


// output
num nodes:  3





An XML object has a length of 1, while an XMLList has a length matching the number of nodes, which could be 1, in which case you can 
treat it as XML :).

From the docs:



   If an XMLList object has only one XML element, you can use the XML class 
methods on the XMLList object directly.
   If you attempt to use XML class methods with an XMLList object containing 
more than one XML object, an exception is thrown;
   instead, iterate over the XMLList collection (using a for each..in statement, for example) and apply the methods to each XML 
object in the collection.



Just think of an XMLList as an Array of XML nodes.
Actually, you use the "Array access operator" (which is a fancy way of saying "square brackets") to access nodes in an XMLList 
object:


var data:XML = 



;

var imgs:XMLList = data.img;
trace(imgs[...@src);

// output:
jpg/cinematic001.jpg

regards,
Muzak

- Original Message - 
From: "Cor" 

To: "'Flash Coders List'" 
Sent: Sunday, July 26, 2009 10:58 AM
Subject: RE: [Flashcoders] Image loader problem



Thank guys!!!

It is an eye opener to see all kinds of different approaches.
I will definitely look at the bulkloader but Muzak's method makes a lot of 
sence to me in my project for now.

@Muzak,

I normally only use the XML class.
I notice you using XMLList.
Could you explain when XML is appropriate and when to use XML.
I read the help, but this does not explain the nitty-gritty.

Thanks again!!

Cor

PS. I love this list




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


Re: [Flashcoders] Image loader problem

2009-07-26 Thread Muzak
Would be nice if you could just throw data at it in one go, rather than having to iterate through your data and adding them one at a 
time.


Something like this:

var data:XML = 



;

var imgLoader:BulkLoader = new BulkLoader();
imgLoader.addEventListener(BulkLoader.COMPLETE, allItemsLoaded, false, 0, true 
);
imgLoader.dataFormat = BulkLoaderDataFormat.XML_FORMAT;
imgLoader.dataField = "@src";
imgLoader.data = data.img;
imgLoader.start();


Now BulkLoader would take care of creating the LoadingItem instances, based on 
the dataFormat and dataField.

And it would handle XML (as above), Array of Objects (complex data), Array of 
Strings (simple data).

// complex data
var data:Array= [{src:"cinematic003.jpg"}, {src:"cinematic003.jpg"}, 
{src:"cinematic003.jpg"}];
var imgLoader:BulkLoader = new BulkLoader();
imgLoader.dataFormat = BulkLoaderDataFormat.COMPLEX_FORMAT;
imgLoader.dataField = "src";
imgLoader.data = data;

// simple data (no need for dataField)
var data:Array= ["cinematic003.jpg", "cinematic003.jpg", "cinematic003.jpg"];
var imgLoader:BulkLoader = new BulkLoader();
imgLoader.dataFormat = BulkLoaderDataFormat.SIMPLE_FORMAT;
imgLoader.data = data;

Just a thought :)

regards,
Muzak


- Original Message - 
From: "Karim Beyrouti" 

To: "Flash Coders List" 
Sent: Sunday, July 26, 2009 12:31 PM
Subject: Re: [Flashcoders] Image loader problem


I went for bulkloader over making my own queued loader - as it has so  many tested features. Here is a little code to help get you 
started  ( if you need it )...



Instantiate the loader...



// New Bulk Loader
imgLoader = new BulkLoader( 'NameOfLoaderInstance');
imgLoader.addEventListener(BulkLoader.COMPLETE, AllItemsLoaded ,  false , 0 , 
true );



Load images:



// Clear the loader of any previously loaded images
imgLoader.removeAll();

// Add all the images to the loading queue
for ( var i : int = 0 ; i < _data.length ; i ++ ){

var record : Object = _data.getItemAt( i );

var item : LoadingItem = imgLoader.add( record['uri'] );
item.addEventListener( Event.COMPLETE , completeHandler , false ,  0 , true );
item.addEventListener( ProgressEvent.PROGRESS , progressHandler ,  false , 0 , 
true );

}

// start loading - one item at a item - this will load images in the  order you 
added them
imgLoader.start( 1 );




Image Loaded Event Handler:




private function completeHandler( e : Event ) : void {

//
// remove event listeners and reference the bitmap
var item:LoadingItem = e.target as LoadingItem;
item.removeEventListener( Event.COMPLETE , completeHandler );
item.removeEventListener( ProgressEvent.PROGRESS, progressHandler );

var sURL : String = item.url.url;

var record : Object = getRecordByKey( sURL, 'uri' );
record.loadid = sURL;

view.addImage( imgLoader.getBitmap( record.loadid ) , record );
}



hope this helps...


Regards


Karim



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


  1   2   3   4   5   6   7   8   9   >