Re: [Flashcoders] MVC style

2012-02-16 Thread Taka Kojima
Not really relevant to the thread, but I saw your CodeJS project Ross, you
should take a look at my solution to Classical Inheritance in JavaScript;

https://github.com/gigafied/minion

Comes with dependency management and a build tool for building out
different classes (and their dependencies) into separate minified JS files.




On Thu, Feb 16, 2012 at 10:32 AM, Ross Sclafani wrote:

> Yeah it hasn't been open source but I'm ready to do that soon.
>
> I'm having trouble parsing your other question, can you rephrase re:
> models knowing about each other?
>
> Ross P. Sclafani
> Owner / Creative Director
> Neuromantic Industries
> http://www.neuromantic.com
> http://ross.sclafani.net
> http://www.twitter.com/rosssclafani
> 347.204.5714
>
> On Feb 18, 2012, at 1:19 PM, John McCormack  wrote:
>
> > A really nice explanation.
> >
> > I tried to find your EastAsMVC after being on your site, is it on the
> way?
> >
> > Also, what comes first, ie. how do the models find out about each other?
> >
> > John
> >
> > On 16/02/2012 00:05, Ross Sclafani wrote:
> >> I am an MVC purist, I always proceed as follows:
> >>
> >> Models should ONLY store information, particularly the state of the
> application and any data retrieved from disk or the network.
> >>
> >> Views hold a reference to a model, watch it for updates, and respond to
> those updates by rendering the model in its current state. 'rendering'
> could refer to manipulating the display list in flash, outputting some text
> to stout (or trace) serving up some JSON from a server app, whatever way of
> expressing the state of the model your app requires. Views are also
> responsible for  handling events that occur in their domain, and forwarding
> them to the appropriate Controllers.
> >> Controllers exist to manipulate models. The only acceptable way to
> alter a model is via a controller. Whether its storing data from a Web
> service in the model, or altering the state of the app in response to user
> interaction, the controllers hold all of the business logic that define how
> the app behaves.
> >>
> >> Ideally, in AS3, the models consist of no methods except accessors that
> retrieve values from private vars and store values there and notify
> subscribed views of the update. Event dispatcher is a fantastic base class
> for a model.
> >> Equally, wherever possible, a controller should only consist of
> methods. Properties are for the model.
> >> This sets up a unidirectional flow of interaction and display. The
> controller populates the model, the model notifies the views, the views
> change. The changed view incites some user interaction, the view tells the
> controller what the user wants to happen, and the controller alters the
> state of the model accordingly, which then notifies the views to change,
> and so on and so forth.
> >>
> >> Ross P. Sclafani
> >> Owner / Creative Director
> >> Neuromantic Industries
> >> http://www.neuromantic.com
> >> http://ross.sclafani.net
> >> http://www.twitter.com/rosssclafani
> >> 347.204.5714
> >>
> >> On Feb 15, 2012, at 1:46 PM, "Merrill, Jason"<
> jason.merr...@bankofamerica.com> wrote:
> >>
> >>> Calculations would not be in the controller, they would be in the
> Model.  Sometimes you can justify them being in the view if it's related to
> the view.  Calculations are also in a Service class if they are part of a
> service in some way.
> >>>
> >>> Jason Merrill
> >>> Instructional Technology Architect II
> >>> Bank of America  Global Learning
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> ___
> >>>
> >>> -Original Message-
> >>> From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
> flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of David Hunter
> >>> Sent: Wednesday, February 15, 2012 1:32 PM
> >>> To: Flash Coders List
> >>> Subject: [Flashcoders] MVC style
> >>>
> >>> Hello list,
> >>>
> >>> If I am making an application with MVC pattern and calculations are
> needed to be performed on the data when the user interacts with the
> application, would you:
> >>>
> >>> do the calculations in the Model?
> >>>
> >>> create a separate class that handles the calculations and puts the
> results in the model?
> >>>
> >>> do the calculations in the Controller?
> >>>
> >>> looking forward to hearing people's thoughts on this,
> >>>
> >>> david
> >>>
> >>> --
> >>> David Hunter
> >>>
> >>> www.davidhunterdesign.com
> >>> +44 (0) 7869 104 906
> >>> ___
> >>> Flashcoders mailing list
> >>> Flashcoders@chattyfig.figleaf.com
> >>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >>>
> >>> --
> >>> This message w/attachments (message) is intended solely for the use of
> the intended recipient(s) and may contain information that is privileged,
> confidential or proprietary. If you are not an intended recipient, please
> notify the sender, and then please delete and destroy all copies and

Re: [Flashcoders] UI Black Box..,?

2012-01-15 Thread Taka Kojima
WIth great power comes great responsibility.

The bottom line is, I'd say AS3 has it's strengths and weaknesses, but
JavaScript is a far more expressive and powerful language.

Overwriting Classes, functions and variables at runtime can be dangerous,
but used correctly you can do a whole lot more, a whole lot easier.

Just take for example, in AS3 you have trace(). Now, I'm not saying
overwriting the trace method is a good idea, but in JavaScript to get trace
outputting the output to somewhere when running in a browser environment,
all you would have to do is this.

if(runningInBrowser){

   trace = function(){
console.log(arguments);
}

}

In AS3 you have to call a separate function which traces and does the
console.log().

This is just a small example, that everyone I'm sure can relate to.
JavaScript lets you do more, there is no arguing that. The only thing you
could argue is whether or not JavaScript being able to do more is a good
thing or a bad thing. Personally I think it has it's cons, but the pros
outweigh them for sure.

Prototypical Inheritance is not a step backwards. If anything, it's a
lateral step. It has a lot more to do with the quality of the code then
what language it's written in.

I've seen tons of bad AS3 code. I've seen tons of bad JavaScript code.

Taka


On Sat, Jan 14, 2012 at 5:31 AM, Henrik Andersson wrote:

> Taka Kojima skriver:
> >
> > The biggest shift is from Classical Inheritance to Prototypical
> > Inheritance, but the key thing to note is that there is still
> inheritance.
> >
> > Prototypical inheritance is definitely more powerful than Classical
> > Inheritance when used right.
> >
>
>
> Yet it is considered insane by most people to change the type of an
> object at runtime.
>
> Any such trickery is best delegated to the Strategy design pattern instead.
> ___
> 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] UI Black Box..,?

2012-01-13 Thread Taka Kojima
I've done a lot of Flash work and a lot of HTML/JS/CSS, and there is
definitely some misinformation in this thread.

jQuery for one is not as great as it is touted it be, it's useful for
things, but it's not the be-all-end-all of HTML development.

It makes it easier to do the following cross browser:

- Query the DOM
- Animate elements
- AJAX
- Event listeners

It does some other stuff, but that's the gist of it. Usually, if you just
use jQuery, your application is going to be a mess.

JavaScript is a very powerful language, ActionScript 2 is an implementation
of JavaScript. AS3 is an implementation of the abandoned ECMAScript 4.

Switching from AS3 to JavaScript/HTML requires a bit of a paradigm shift,
but it's really not that much different (taking into account the current
capabilities of HTML5/JS/CSS). Instead of Sprites you have divs, yeah there
are a few more semantics, especially when getting into HTML5 but it's very
straightforward, an  represents a header,  represents an image and
so on.

The biggest shift is from Classical Inheritance to Prototypical
Inheritance, but the key thing to note is that there is still inheritance.

Prototypical inheritance is definitely more powerful than Classical
Inheritance when used right.

Anyway, coming from a guy who's done a lot of both, HTML5/JS/CSS can be
quite fun to work with, provided you have the right toolsets and mindset.

I put together a JS library for Classical Inheritance in JS btw (heavily
influenced by AS3), you can find it here:

https://github.com/gigafied/minion

Might help some of you guys out trying to do stuff in the HTML/JS world.

On Fri, Jan 13, 2012 at 10:56 PM, Ktu wrote:

> On Fri, Jan 13, 2012 at 8:44 PM, Karl DeSaulniers  >wrote:
>
> > @Ktu
> > I see what your saying.. I agree.
> > The technology is out there for HTML to get a complete face-lift if you
> > will.
> > If not a whole new write-up. And from this response, I understand your
> > black box now.
> > Sry if any disconnect. I guess in my pursuit to make what was available
> to
> > me work
> > I didn't worry about if that structure would or could change.
> >
> i love control. i like being in control so this is why i have an issue with
> black boxes. i still believe that black boxes are inhibitors to progress
>
> >
> > I don't see why it couldn't be done, and to add to that, browsers could
> > use a rewrite as well.  0.õ
> >
> > ..but then I guess some would argue that the  tag is what your
> > talking about.
>
> But that too is a black box IMO and I am sure yours as well. Correct me if
> > I am wrong.
> >
> you are not wrong. in my opinion the canvas tag is another black box that
> allows for a different (and in some ways lower level) functionality. its
> nice that this black box is very abstract so you can accomplish more within
> it. this abstract layer is similar to flash. i mean, grant skinner created
> a framework that emulates the flash display architecture when using the
> canvas tag. this tag both helps and hurts my case.
>
> >
> > Can you give an example of what your talking about.. or
> > the idea behind a black-less box?? :)
> >
> not sure if i understand your question now, but it has sparked a thought
> that seems to connect things together for me, and might give insight as to
> why i think about this.
>
> black boxes are useful. they can really make things easier sometimes. as it
> seams, we keep adding more and more black boxes to boxes to make things
> easier. this is fine and good until we start trying to use the black boxes
> the way they were not intended. it would be nicer if i could change the way
> that box worked, but i cannot.
>
> take for example this correlation about black boxes.
>
> (excuse my poor html knowledge)
> I want a scrollable block of content in my html page that only takes up
> part of the screen.
> i create a  give it size and tell it overflow = hidden (?) and that it
> should use a scrollbar (somehow?)
>
> if i did that in flash
> create a sprite
> set scrollRect and give content
> either use scrollbar components from some framework or write my own
>
> if i did that in C++
> i could, go on forever making all the things!
> or utilize a bunch of libraries to make it almost as simple (relatively
> please) as the html.
>
>
> the more black boxes we have the less control we have. in my own work, i
> create white boxes (black boxes i have source code to, do they have a
> proper name?). i have created the building blocks to serve the common
> tasks. i wonder at people who spend any time working on 'browser
> compatibility'. the example above has shown me that i like boxes, but not
> black ones, and if there is anything i can do, it will never be black. my
> example above shows how boxes are helpful, but i think i really do not like
> the closed aspect of it.
>
> my head now reeling with new off topic thoughts i will stop. what started
> as an emotional response to my own past experiences (first thread) has
> turned into yet another dive into the 

Re: [Flashcoders] Simplify XML Call

2011-08-14 Thread Taka Kojima
errr...

function getNumItems(level:int, xml:XML):int{
var levelXML:XML = xml.menu;
 for(var i:int = 0; i < level; i ++){
levelXML = levelXML.item[whichItems[i]];
 }
return levelXML.length();
}

On Sun, Aug 14, 2011 at 1:24 AM, Taka Kojima  wrote:

> I don't even know why I'm responding to this, but. Ktu gave you the answer
> yet you seemed to ignore it? You don't need an eval at all.
>
> function getNumItems(level:int, xml:XML):int{
>  var levelXML:XML = xml.menu;
>  for(var i:int = 0; i < level; i ++){
>  levelXML = levelXML.item[whichItems[level]];
> }
> return levelXML.length();
> }
>
> does exactly what this would do, if AS3 had an eval:
>
> var j:String = "xml.menu.item[whichItems[0]]";
> var k:String = new String();
> var l:int = level;
> while (l--)
> {
> k += ".item[whichItems[" + String(l) + "]]";
> }
> totalItems = (j + k);
>
> Taka
>
>
> On Sat, Aug 13, 2011 at 7:17 PM, Merrill, Jason <
> jason.merr...@bankofamerica.com> wrote:
>
>> And here's another recursive function example for XML, slightly different,
>> with a more complex structure, showing how to get all values from some
>> attributes in an XML file (in this case, firstName and lastName), no matter
>> where or how deep they lie:
>>
>> var peopleXML:XML =
>> 
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>> lastName="Oprah"/>
>>
>>
>>> lastName="Elkins"/>
>>> lastName="Downing"/>
>>
>>
>>
>>
>>
>>
>>
>> ;
>>
>>
>> function recurseXML(xml:*):void
>> {
>>var xmlList:XMLList = xml.children();
>>for each (var currentNode:* in xmlList)
>>{
>>trace(currentNode.@firstName+" "+currentNode.@lastName);
>>if(currentNode.children()) recurseXML(currentNode);
>>}
>> }
>>
>> recurseXML(peopleXML);
>>
>> //Traces:
>> Bob Smith
>> Timmy Smith
>> Jenny Jones
>> Sal Stephens
>> Marcia Marquez
>> Julio Rogers
>> Tom Williams
>> Mary Jones
>> Albert Denniston
>> Barney Elmington
>> Campo Fatigua
>> Harpo Oprah
>> Hugo Boss
>> Benny Elkins
>> Sheri Downing
>> Marcia Marquez
>> Manny Peterson
>> Joe Merritt
>>
>>  Jason Merrill
>>  Instructional Technology Architect II
>>  Bank of America  Global Learning
>>
>>
>>
>>
>>
>> ___
>>
>>
>> -Original Message-
>> From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
>> flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason
>> Sent: Saturday, August 13, 2011 9:58 PM
>> To: Flash Coders List
>> Subject: RE: [Flashcoders] Simplify XML Call
>>
>> >> Then I think I hit on what Jason was suggesting:
>>
>> Not really. :) I think you're over complicating this.  This is all I was
>> suggesting you do from my original suggestion, it's pretty straightforward
>> (this is a test case you could copy paste and run):
>>
>> //DUMMY DATA:
>> var myXML:XML = 
>>> backgroundImage="images/background.png">
>>
>>
>>
>>> fileURL="assets/images/simulations/ATC/atc_701201045.png"
>> invertedFileURL="myImages/myFileInverted1.png" legible="true" amount="78400"
>> />
>>> fileURL="myImages/myFile2.png"
>> invertedFileURL="myImages/myFileInverted2.png" legible="false"
>> amount="743600" />
>>> fileURL="myImages/myFile3.png"
>> invertedFileURL="myImages/myFileInverted3.png" legible="tru

Re: [Flashcoders] Simplify XML Call

2011-08-14 Thread Taka Kojima
I don't even know why I'm responding to this, but. Ktu gave you the answer
yet you seemed to ignore it? You don't need an eval at all.

function getNumItems(level:int, xml:XML):int{
 var levelXML:XML = xml.menu;
 for(var i:int = 0; i < level; i ++){
 levelXML = levelXML.item[whichItems[level]];
}
return levelXML.length();
}

does exactly what this would do, if AS3 had an eval:

var j:String = "xml.menu.item[whichItems[0]]";
var k:String = new String();
var l:int = level;
while (l--)
{
k += ".item[whichItems[" + String(l) + "]]";
}
totalItems = (j + k);

Taka


On Sat, Aug 13, 2011 at 7:17 PM, Merrill, Jason <
jason.merr...@bankofamerica.com> wrote:

> And here's another recursive function example for XML, slightly different,
> with a more complex structure, showing how to get all values from some
> attributes in an XML file (in this case, firstName and lastName), no matter
> where or how deep they lie:
>
> var peopleXML:XML =
> 
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> lastName="Elkins"/>
> lastName="Downing"/>
>
>
>
>
>
>
>
> ;
>
>
> function recurseXML(xml:*):void
> {
>var xmlList:XMLList = xml.children();
>for each (var currentNode:* in xmlList)
>{
>trace(currentNode.@firstName+" "+currentNode.@lastName);
>if(currentNode.children()) recurseXML(currentNode);
>}
> }
>
> recurseXML(peopleXML);
>
> //Traces:
> Bob Smith
> Timmy Smith
> Jenny Jones
> Sal Stephens
> Marcia Marquez
> Julio Rogers
> Tom Williams
> Mary Jones
> Albert Denniston
> Barney Elmington
> Campo Fatigua
> Harpo Oprah
> Hugo Boss
> Benny Elkins
> Sheri Downing
> Marcia Marquez
> Manny Peterson
> Joe Merritt
>
>  Jason Merrill
>  Instructional Technology Architect II
>  Bank of America  Global Learning
>
>
>
>
>
> ___
>
>
> -Original Message-
> From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
> flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason
> Sent: Saturday, August 13, 2011 9:58 PM
> To: Flash Coders List
> Subject: RE: [Flashcoders] Simplify XML Call
>
> >> Then I think I hit on what Jason was suggesting:
>
> Not really. :) I think you're over complicating this.  This is all I was
> suggesting you do from my original suggestion, it's pretty straightforward
> (this is a test case you could copy paste and run):
>
> //DUMMY DATA:
> var myXML:XML = 
> backgroundImage="images/background.png">
>
>
>
> fileURL="assets/images/simulations/ATC/atc_701201045.png"
> invertedFileURL="myImages/myFileInverted1.png" legible="true" amount="78400"
> />
> fileURL="myImages/myFile2.png"
> invertedFileURL="myImages/myFileInverted2.png" legible="false"
> amount="743600" />
> fileURL="myImages/myFile3.png"
> invertedFileURL="myImages/myFileInverted3.png" legible="true"
> amount="3213212" />
> fileURL="myImages/amountkeying/myFile4.png"
> invertedFileURL="myImages/myFileInverted4.png" legible="true"
> amount="43242323" />
> fileURL="myImages/myFile5.png"
> invertedFileURL="myImages/myFileInverted5.png" legible="true" amount="78400"
> />
> fileURL="myImages/myFile6.png"
> invertedFileURL="myImages/myFileInverted6.png" legible="false"
> amount="342132" />
> fileURL="myImages/myFile7.png"
> invertedFileURL="myImages/myFileInverted7.png" legible="true" amount="78400"
> />
>
>
>
>
> fileURL="assets/images/simulations/ATC/atc_701201045.png"
> invertedFileURL="myImages/myFileInverted1.png" legible="true" amount="78400"
> />
> fileURL="myImages/myFile2.png"
> invertedFileURL="myImages/myFileInverted2.png" legible="false"
> amount="743600" />
> fileURL="myImages/myFile3.png"
> invertedFileURL="myImages/myFileInverted3.png" legible="true"
> amount="3213212" />
> fileURL="myImages/amountkeying/myFile4.png"
> invertedFileURL="myImages/myFileInverted4.png" legible="true"
> amount="43242323" /

Re: [Flashcoders] XML Question

2010-11-04 Thread Taka Kojima
You would do xml..product.(@prodCode == id);

Yep, that simple.

Taka

On Thu, Nov 4, 2010 at 11:17 AM, Matt S.  wrote:

> I know this is easy, but I'm having trouble finding the answer: if I'm
> iterating through XML like so:
>
> return xml.category.(@name == cat[0]).subcategory.subcategory2.(@name
> == cat[1]).product.(@prodCode == String(id));
>
> where "cat" is an array, eg cat = ["men","shirts"]
>
> but what I want to do is search the ENTIRE XML for the first
> occurrence, in any category/subcategory, of a @prodCode that matches
> "id", how would I do that?
>
> eg,I want to do something like
>
> return xml.category.*.subcategory.subcategory2.*.product.(@prodCode ==
> String(id));
>
> but that's obviously not the actual code. Does anyone have any suggestions?
>
> Thanks!
>
> .m
> ___
> 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] NOOBed - wtf basic procedural tween skipping

2010-09-29 Thread Taka Kojima
This is going to sound abrupt but have you ever heard of a tweening engine?

http://www.greensock.com/tweenlite/

On Wed, Sep 29, 2010 at 10:02 AM, Bob Wohl  wrote:

> Up the frame rate and lower the x position update or use a tweening
> class. For the most part I don't really see any skipping/chugging.
>
>
> On Wed, Sep 29, 2010 at 9:45 AM, jared stanley  >wrote:
>
> > hey gang i have no idea what's going on here -
> >
> > http://lab.freestyleinteractive.com/jared/wtf/
> >
> > this is a basic tween, clip.x+=20 or whatever.
> >
> > It's totally skipping/chugging? what is up with that? doing a motion
> tween
> > looks fine, it's just when it's procedural that it's funky.
> > We started noticing it on a project, now it's killing me - has it always
> > been there? jeez.
> > ___
> > Flashcoders mailing list
> > Flashcoders@chattyfig.figleaf.com
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Photo-realistic 3d in as3

2010-08-16 Thread Taka Kojima
I would like to point out that "photo realistic 3d" in Flash is not exactly
possible. Especially, seeing as this is your first 3D project, I feel
obligated to inform you of this.

Most of the better looking "3D" sites done with Flash, use a mix of
PaperVision and optical illusions of rendered animation (i.e. after effects
pieces) and dovetail them together. Importing 3D models to use in AS3
through pv3d, is not exactly fast. Models have to have a low polygon count
otherwise your fps is going to be horrible.

On Mon, Aug 16, 2010 at 10:50 AM, Merrill, Jason <
jason.merr...@bankofamerica.com> wrote:

> Then you should probably narrow it down between Away3D and
> Papervision3D.  Adobe is announcing 3D support for the Flash player at
> Max in October it sounds like, but that's a ways off.
>
> I know Papervision3D can do what you're asking.
>
>
> Jason Merrill
>
> Instructional Technology Architect
> Bank of America   Global Learning
>
> Join the Bank of America Flash Platform Community  and visit our
> Instructional Technology Design Blog
> (Note: these resources are only available for Bank of America
> associates)
>
>
>
>
>
>
> -Original Message-
> From: flashcoders-boun...@chattyfig.figleaf.com
> [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of mika
> Sent: Monday, August 16, 2010 1:47 PM
> To: Flash Coders List
> Subject: Re: [Flashcoders] Photo-realistic 3d in as3
>
> I plan to target FP10, but I have a 3d designer doing the modelling
> work, so i will need to import models. The app is part of a large
> project, and I want it to be able to grow overtime.
> A solid engine is hence required.
>
> The models will range from soccer balls, rugby ball, hand ball ... to
> shirts, sockets and so on. But I'd like to be able to extend to any kind
> of 3d model over time.
> We might also model a full character to 'wear' the products.
>
>
> On Mon, Aug 16, 2010 at 11:09, Kerry Thompson
> wrote:
>
> > Mika wrote:
> >
> > > For an upcoming project, I will need to dwelwe in the 3d world of
> flash.
> > I
> > > am in the stage of choosing the engine.
> > >
> > > If you were to keep as sole paramater the best photo realistic
> > > render, to display products (very little animation, mostly rotate
> > > around), what
> > engine
> > > would you choose ?
> >
> > If FP 10 is your target, you probably wouldn't need anything but Flash
>
> > (or, more accurately, AS3). Flash now has z-order, and you can do
> > simple rotations just by manipulating the z depth of your faces.
> >
> > It is kind of primitive, and you have to do some fancy dancing even to
>
> > rotate a cube, but it can be done.
> >
> > Cordially,
> >
> > Kerry Thompson
> > ___
> > Flashcoders mailing list
> > Flashcoders@chattyfig.figleaf.com
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Saving MC as image

2010-08-16 Thread Taka Kojima
Like Henrik says, just use FileReference.

http://www.quietless.com/kitchen/dynamically-create-an-image-in-flash-and-save-it-to-the-desktop-or-server/

On Mon, Aug 16, 2010 at 10:01 AM, Henrik Andersson wrote:

> Lehr, Theodore wrote:
>
>>  server-side code ... save the image locally
>>
>
> I hope that you see the issue here.
>
> Just use a FileRefference instead.
>
> ___
> 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] Querying XML

2010-08-06 Thread Taka Kojima
First of all:

Henrik, why rewrite core functionality? E4X is a standard, telling him to
write his own loop for data is something that I strongly disagree with.

The only case where I can see writing your own loops for XML would be
beneficial would be if you really had a performance issue and needed to
optimize and even then, unless you are making 100+ E4X calls would it really
make a difference... maybe.

"Do your own loop and don't relay on a syntax feature that hides the loop
from you."

Does that mean we should all start rewriting code that's part of the core
library so that we don't rely on anything we didn't write ourselves? Because
that is essentially what you are suggesting.

Theodore, I'm sure you could have googled something like "E4X multiple
conditions" and found the answer to your question in a couple of minutes,
but anyway, you handle multiple conditions with something like the
following:

peopleXML.person.(@group == dd_group.value.toString() && @room ==
dd_room.value.toString());

You could also do an or instead of an and (||).

Taka


On Fri, Aug 6, 2010 at 9:46 AM, Lehr, Theodore wrote:

> it does - based on the last condition How can I "query" the xml using
> multiple conditions?
>
> 
> From: flashcoders-boun...@chattyfig.figleaf.com [
> flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Henrik Andersson [
> he...@henke37.cjb.net]
> Sent: Friday, August 06, 2010 12:40 PM
> To: Flash Coders List
> Subject: Re: [Flashcoders] Querying XML
>
> Lehr, Theodore wrote:
> > I am trying:
> >
> > buildXML = peopleXML.person.(@group == dd_group.value.toString())&&
>  peopleXML.person.(@room == dd_room.value.toString());
> >
>
> I am surprised that it even returns an XMLList, wait, does it?
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Querying XML

2010-08-05 Thread Taka Kojima
E4X is a much better approach than looping through an XML object and adding
items to an XMLList.

An E4x command automatically returns an XMLList type object.

On Thu, Aug 5, 2010 at 11:47 AM, Nathan Mynarcik wrote:

> You would need to make a var that is an XMLList that pulls only the nodes
> that have the value "a".  Then you can trace out your XMLList and it will
> only be the ones you need.
>
> Nathan Mynarcik
> nat...@mynarcik.com
> 254.749.2525
> www.mynarcik.com
>
>
> On Thu, Aug 5, 2010 at 2:18 PM, Lehr, Theodore  >wrote:
>
> > Is there a way to only show certain xml based on a value - for instance -
> > say I have:
> >
> > var aXML:XML =
> > 
> >
> >
> >
> >
> >
> > 
> >
> >
> > So if someone picks "a" from a drop down - I would then only display the
> > ones that have the value of a in a datagrid...
> >
> > I am used to just doing something like:
> >
> > var myDP:DataProvider = new DataProvider(aXML);
> >
> > How can I remove xml members or keep them from being shown?
> >
> > ___
> > Flashcoders mailing list
> > Flashcoders@chattyfig.figleaf.com
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Querying XML

2010-08-05 Thread Taka Kojima
Look into e4x

To only show items with value="a" it would be aXML.item.(@value == "a")

On Thu, Aug 5, 2010 at 11:18 AM, Lehr, Theodore
wrote:

> Is there a way to only show certain xml based on a value - for instance -
> say I have:
>
> var aXML:XML =
> 
>
>
>
>
>
> 
>
>
> So if someone picks "a" from a drop down - I would then only display the
> ones that have the value of a in a datagrid...
>
> I am used to just doing something like:
>
> var myDP:DataProvider = new DataProvider(aXML);
>
> How can I remove xml members or keep them from being shown?
>
> ___
> 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] Question on variable init in a for loop

2010-08-04 Thread Taka Kojima
It's not a global because if you have a MovieClip called testMC on the stage
and are inside testMC and try to do trace(greeting), you will get an error.

To access that property you have to do parent.greeting, therefore because
you have to be aware of the scope to access it, it is not "global".

On Wed, Aug 4, 2010 at 2:30 PM, Kerry Thompson wrote:

> Henrik Andersson wrote:
>
> > My definition of a global variable is:
> > * One single value per application
> > * Can be accessed by any code
> >
> > A public property only satisfies the second condition.
>
> Again, I think we're talking about a purely semantic difference, not a
> functional one. Actually, Taka has a point--AS3 may not have true
> globals at all. I think he may be right, as long as we are using OOP.
>
> Consider this, though. Creat a new .fla, put a dynamic text field on
> stage, call it myText, then put this code in the first frame:
>
> var greeting:String = "Hello. Am I global?";
>
> myText.text = greeting
> stop();
>
> That's very AS2-ish code, but it works as an AS3 .fla. Is it a global?
>
> But, to your point about one single value per application,
> myObject.myPublicVar can have only one value. True, the class can be
> instantiated many times, but a non-static variable doesn't have a
> value until its class is instantiated.
>
> Even with these conditions, when you start using namespaces, you can
> have exactly the same variable in different name spaces. In that case,
> you could have myClass.myStaticPublicVar in two or more name spaces.
> That puts it in kind of the same category as public variables, doesn't
> it?
>
> A lot of us here came from Director, myself included, and we're used
> to Lingo's concept of a global namespace. I've programmed in many
> other languages--C, C++, COBOL, Forrtran, and others--and AS3 is the
> first I've used that doesn't really have a global namespace.
>
> Cordially,
>
> Kerry Thompson
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Question on variable init in a for loop

2010-08-04 Thread Taka Kojima
Public variables, static or otherwise do NOT classify as global variables.

http://en.wikipedia.org/wiki/Global_variable

A global variable is something that is accessible everywhere without any
scope whatsoever.

By having to call MyClass.variable or myClassInstance.variable, it is quite
apparent that the property "variable" is not global, because you have to
explicitly call MyClass or a MyClass instance to access it.

Now, some developers might imitate global variables in AS3 by doing
something like making a class called Global, and accessing static variables
such as Global.variable1, Global.variable2, etc.

Taka

On Wed, Aug 4, 2010 at 11:15 AM, Kerry Thompson wrote:

> Henrik Andersson wrote:
>
> > Public static properties are the only thing that can be compared with a
> > global. Note the word "static".
> >
> > And public is not the default, internal is.
>
> You're right, Henrick. Internal is the default, not public. My bad.
>
> I think we're splitting hairs on public vs. public static. A public
> variable, static or otherwise, is available to any caller.
> Technically, you are probably right, because a public variable isn't
> available until an object is intantiated from the class. A public
> static variable belongs to the class, not the instance, though, so it
> is available without instantiating an object. In fact, I use public
> static variables for my custom messages--I have a CustomMessage class
> specifically for that purpose.
>
> Nonetheless, once instantiated, and public variable is global whether
> it is static or not. That fits my concept of global.
>
> Cordially,
>
> Kerry Thompson
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Create your own t-shirt

2010-08-04 Thread Taka Kojima
And you need to find out how to send a ByteArray back to a backend service
to save said "t-shirt" as an image file.

With that and Jack's TransformManager, those are the two main building
blocks.

On Wed, Aug 4, 2010 at 10:10 AM, Jack Doyle  wrote:

> This may be helpful for allowing interactive
> selecting/scaling/rotating/moving:
> http://www.greensock.com/transformmanageras3/
>
> There's an AS2 flavor as well. Both accommodate scaling multiple selections
> even if each object is rotated at a different angle. Transformations can be
> exported and imported as XML to make it easy to save and reload the state.
>
> I know several t-shirt making apps use it. Good luck.
>
> Jack
>
> -Original Message-
> From: Karl DeSaulniers [mailto:k...@designdrumm.com]
> Sent: Wednesday, August 04, 2010 9:27 AM
> To: Flash Coders List
> Cc: Flash Coders List
> Subject: Re: [Flashcoders] Create your own t-shirt
>
> Well, I did say I'd purchase it.
> But I hear your point. I know how to do all those things, but needed
> this in somewhat of a hurry and was seeing if I could find a fish
> instead of congering one out of mid air. So to speak. But thank you
> for your response. No harm no foul.
>
> Best,
> Karl
>
> Sent from losPhone
>
> On Aug 4, 2010, at 8:55 AM, "Merrill, Jason"
>   > wrote:
>
> >>> Does anyone know where I might find an AS2 (preferably) or AS3
> > "create your own t-shirt" tutorial or any advice on one that is made
> > and
> > for sale?
> >
> > Does your t-shirt maker also have to have sharks and lasers?
> >
> >>> I had no luck on google, but I may not be searching for the right
> >>> key
> > phrase.
> >
> > Try this search:  Flash Tutorial T-Shirt Maker Sharks Lasers
> >
> > Seriously though, you're thinking about this the wrong way - looking
> > for
> > an EXTREMELY specific example.  You need to not think about the
> > specific
> > result you want (because it's extremely unlikely you'll find a
> > tutorial
> > on it), and instead ask questions and find tutorials on knowledge gaps
> > in Actionscript and Flash related to the problem you are trying to
> > solve.  For example:
> >
> > How do I detect when two graphics are overlapping?
> > How would I go about allowing the user to draw on the screen?
> > How can I send graphics to a printer?
> > Is there a tutorial out there on loading XML?
> > etc.
> >
> > By asking for a tutorial very specific to your project, it seems like
> > you just want something to show you everything you should do for your
> > project, instead of learning the Flash/Actionscript things you need to
> > learn to tackle any project.  So I would advise you to learn to fish
> > instead of ask for a fish.  Sorry if that sounds harsh, I don't mean
> > it
> > to be - it's just the best advice I can give you.
> >
> >
> > Jason Merrill
> >
> > Instructional Technology Architect
> > Bank of America   Global Learning
> >
> > Join the Bank of America Flash Platform Community  and visit our
> > Instructional Technology Design Blog
> > (Note: these resources are only available for Bank of America
> > associates)
> >
> >
> > ___
> > Flashcoders mailing list
> > Flashcoders@chattyfig.figleaf.com
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
>
>
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] % glyph not displaying

2010-08-02 Thread Taka Kojima
Try explicitly adding the "%" to the "Include these characters" field.

On Mon, Aug 2, 2010 at 12:30 PM, Merrill, Jason <
jason.merr...@bankofamerica.com> wrote:

> How exactly did you embed the font in the .swf and what glyph sets did
> you select when you did?
>
>
> Jason Merrill
>
> Instructional Technology Architect
> Bank of America   Global Learning
>
> Join the Bank of America Flash Platform Community  and visit our
> Instructional Technology Design Blog
> (Note: these resources are only available for Bank of America
> associates)
>
>
>
>
>
>
> -Original Message-
> From: flashcoders-boun...@chattyfig.figleaf.com
> [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of
> Mendelsohn, Michael
> Sent: Monday, August 02, 2010 3:28 PM
> To: Flash Coders List
> Subject: [Flashcoders] % glyph not displaying
>
> Hi list...
>
> I've embedded Times New Roman in a swf and I'm populating a TextField
> via flashvars set in that embedded Times font.  The % glyph isn't
> displaying.  No matter what type of entity I include in the flashvar
> string (\u0025 or &37; or %), the percent sign isn't showing up.  In
> Windows Character Map, the % sign is obviously part of the character
> set. Am I missing something?
>
> Perplexed,
> - Michael M.
>
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] SCORM Q - Strategies for saving large suspend data strings

2010-07-28 Thread Taka Kojima
The JSON encoder class might do it automatically by passing an XML object to
the constructor, idk, look into it maybe.

It's also not very hard to loop through an XML node and convert all of it's
attributes and children nodes into an object, something like this:

(I took 40 seconds to write this, please don't use this in production code
without proper testing/verification).

function xmlToObj($xml:XML):Object{
var obj:Object = {};
for each(var node:XML in $xml.children()){
obj[node.name()] = xmlToObj(node);
}
 var attributes:XMLList = $x...@*;
 for (var i:int = 0; i < attributes.length(); i++){
trace(attributes[i].name());
obj[String(attributes[i].name())] = attributes[i];
}
return obj;
}

On Wed, Jul 28, 2010 at 3:51 PM, Matt Perkins  wrote:

> Right, learn was probably a strong word. Just meant that I'd never
> used it before.
>
> Is there an automated was to convert the XML to JSON with AS3?
>
> --
> Matt Perkins
> -
> http://www.nudoru.com
>
> On Jul 28, 2010, at 6:12 PM, Taka Kojima  wrote:
>
> > There isn't really anything such as "learning JSON", JSON is basically
> just
> > an object, and is your best bet.
> >
> > You can convert an XML string to JSON, store it, and then when you need
> it
> > reconvert it to XML if you really need to, but unless you're doing things
> > with E4X that is probably unnecessary.
> >
> > There are several libraries for a number of different languages to work
> with
> > JSON, a lot of languages have the functionality built in, for AS3 you can
> > use the as3 core lib or you can use this:
> >
> > http://www.thanksmister.com/index.php/archive/json-lite/
> >
> >
> > Taka
> >
> > On Wed, Jul 28, 2010 at 3:03 PM, Matt Perkins 
> wrote:
> >
> >> Wondering if someone has had this problem and found a good solution ...
> >>
> >> I've developed a social simulation that has a lot of data that i need to
> >> save between user sessions in the suspend_data SCORM variable to our
> LMS.
> >> I'm formatting this data as XML since 1, has a good structure and 2, i
> know
> >> it. Suspend_data only has 4k of space and my XML (as a string) is pretty
> big
> >> - doubly so since the LMS encodes it and all of the single char <, > and
> /'s
> >> get turned into 4 chars. But i've used attributes and 1-2 char tag names
> >> where i can.
> >>
> >> I'm going to try to compress the string with ByteArray and see if that
> >> helps, but I'm not sure if the "special characters" will mess with the
> LMS
> >> communication - I've had that happen many times before with just HTML
> page
> >> text.
> >>
> >> Other option is to learn JSON and do it that way.
> >>
> >> Have anyone else faced something like this and solved it?
> >>
> >> --
> >> Matt Perkins
> >> 
> >> http://www.nudoru.com
> >>
> >> ___
> >> Flashcoders mailing list
> >> Flashcoders@chattyfig.figleaf.com
> >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >>
> > ___
> > Flashcoders mailing list
> > Flashcoders@chattyfig.figleaf.com
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] SCORM Q - Strategies for saving large suspend data strings

2010-07-28 Thread Taka Kojima
There isn't really anything such as "learning JSON", JSON is basically just
an object, and is your best bet.

You can convert an XML string to JSON, store it, and then when you need it
reconvert it to XML if you really need to, but unless you're doing things
with E4X that is probably unnecessary.

There are several libraries for a number of different languages to work with
JSON, a lot of languages have the functionality built in, for AS3 you can
use the as3 core lib or you can use this:

http://www.thanksmister.com/index.php/archive/json-lite/


Taka

On Wed, Jul 28, 2010 at 3:03 PM, Matt Perkins  wrote:

> Wondering if someone has had this problem and found a good solution ...
>
> I've developed a social simulation that has a lot of data that i need to
> save between user sessions in the suspend_data SCORM variable to our LMS.
> I'm formatting this data as XML since 1, has a good structure and 2, i know
> it. Suspend_data only has 4k of space and my XML (as a string) is pretty big
> - doubly so since the LMS encodes it and all of the single char <, > and /'s
> get turned into 4 chars. But i've used attributes and 1-2 char tag names
> where i can.
>
> I'm going to try to compress the string with ByteArray and see if that
> helps, but I'm not sure if the "special characters" will mess with the LMS
> communication - I've had that happen many times before with just HTML page
> text.
>
> Other option is to learn JSON and do it that way.
>
> Have anyone else faced something like this and solved it?
>
> --
> Matt Perkins
> 
> http://www.nudoru.com
>
> ___
> 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] Listeners (was no subject)

2010-07-27 Thread Taka Kojima
and you can also do...

function onSomeEvent(e:Event = null):void{
}

and then just call the function directly, without creating a new Event
instance. i.e.:

onSomeEvent();


On Tue, Jul 27, 2010 at 12:20 PM, Paul Andrews  wrote:

> On 27/07/2010 19:37, Henrik Andersson wrote:
>
>> Paul Andrews wrote:
>>
>>> If you try and call a function designed to be an event handler directly,
>>> you must create an event object instance to correspond with the event
>>> argument yourself when it is called.
>>>
>>>
>> You must at the very least give the parameter a value. A null reference
>> counts as a value. You can either make it optional or simply pass null each
>> time you are calling it yourself. If it is valid depends on what the
>> function does with it.
>>
>
> Well it will work, though I think it's not the best practice.
>
> If I have an event handler that does "taskX", and I want to do taskX
> directly without an event, I would code this as
>
> function onSomeEvent(e:Event):void {
> taskX();
> }
>
> and have a separate taskX() function to allow that to be called directly.
> Then there's no ambiguity over whether a function is an event handler or
> not. Generally speaking calling event handlers directly is to be avoided.
>
> 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
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Listeners (was no subject)

2010-07-27 Thread Taka Kojima
Here's the deal:

If you had googled your error message "1046: Type was not found or was not a
compile-time constant: Event", you would have found the answer to your first
question in the first 3 results.

A 1046 error is a very common error message, seasoned developers already
know what's wrong before they finish reading the message, but that's not the
point. The point is that this list shouldn't be the first option for such a
trivial issue.

Secondly, it is basic programming knowledge that you never pass arguments to
a listener/callback function by doing
testFunction(callbackFunction(argument1,argument2)), because that will run
the function and use the return value of that function as the argument for
testFunction.

In my opinion, both of his questions, albeit they were encountered while
working with flash/as3, are not really flash/as3 related questions. The
first is not knowing when/how to run a simple search to solve basic
programming bugs/errors. The second is just a general lack of basics in
programming in general.

Maybe I'm alone here, which is fine and John, I am not trying to single you
out or anything like that, I just see too many of these types of questions
happen on this list. There are some notorious offenders in the past that I'm
sure we can all think of (at least those of us that have been on this list
for a while).

I'm subscribed to this list to help people when I see an actual issue that
really warrants help, maybe I should just ignore these types of messages in
general and not get myself involved, I don't know.

On Tue, Jul 27, 2010 at 11:54 AM, Henrik Andersson wrote:

> Kerry Thompson wrote:
>
>> Henrik Andersson wrote:
>>
>>  Custom events are usually overkill.
>>>
>>
>> If I understand you correctly, Henrik, I disagree. Custom events are
>> incredibly useful.
>>
>
> That they are. But they are not miracle tool. You should use them wisely
> and only when it makes sense.
>
>
>
>> AS3 is event-driven, and I routinely have all sorts of custom events.
>> In a recent game, I added event listeners to 7 different custom events
>> in the main class's constructor. When an animation in a MC finishes,
>> the MC sends the ANIMATION_FINISHED message. When the timer fires, it
>> sends another message. When the student answers a question, I send
>> another message.
>>
>
> Sounds like you missed Event.COMPLETE, it is just as good to signal when a
> task is done.
>
>
>
>> I have a class that extends Event, and custom events are defined in
>> this class. So, when you send a custom event, you get an event object
>> just as you would with a system event.
>>
>
> Did you bother adding any properties in your custom class? If not, you
> could just have used the Event class instead.
>
>
>
>> To me, this is a lot cleaner and easier to follow than callbacks or
>> calls to other methods. It's also less prone to mysterious bugs--when
>> you call a method, it always returns to the caller. If that caller no
>> longer exists, you get a crash that can be very hard to diagnose. When
>> you send a custom message, the code doesn't automatically return to
>> the sender.
>>
>>
> Actionscript is a garbage collected language, objects can not vanish while
> they are used as the value of this for a method. And if you manage to pull a
> stunt like that in something like c++, bad 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] Listeners (was no subject)

2010-07-26 Thread Taka Kojima
John,

This is going to come across as harsh, however you really should maybe go
and get a book on AS3.

These problems, forgetting an import, trying to pass arguments to a
listener, etc. are pretty rudimentary, and not really the purpose of this
list.

Taka

On Mon, Jul 26, 2010 at 10:58 AM, John Singleton  wrote:

>
>
>  Original Message 
>
> > From: Henrik Andersson 
> > To: Flash Coders List 
> > Sent: Mon, July 26, 2010 12:06:55 PM
> > Subject: Re: [Flashcoders] (no subject)
> >
> > John Singleton wrote:
> > >  function  RotateGearsLoaded(e:Event):void
> > Why is that? I tried to pass that var like  this:
> > >
> > >
>
> >loader.contentLoaderInfo.addEventListener(Event.COMPLETE,RotateGearsLoaded(displayGearsCounter));
> >
> > >
> >
> > RotateGearsLoaded  returns void, not Function. The return value is not a
> > legal listener. Yet  you are calling it here to get the listener to add.
> >
> > Remember, you are not  the one calling the listener, thusly, you can't
> > decide the  arguments.
>
> That makes sense. Unfortunately, it's not clear to me how I should proceed.
> Could you either recommend a tutorial or give an example?
> TIA,
> John
> PS. Original code for those who skipped this message because it had no
> subject:
>
>function Main()
>{
>InitRotateGears();
>}
>
>function InitRotateGears()
>{
>for (var i = 0; i < gearsPaths.length; i++)
>{
>RotateGears();
>displayGearsCounter += 1;
>}
>
>function RotateGears()
>{
>var path:String = new String();
>path = gearsPaths[displayGearsCounter];
>var req:URLRequest = new URLRequest(path);
>var loader:Loader = new Loader();
>loader.load(req);
>
>
> loader.contentLoaderInfo.addEventListener(Event.COMPLETE,RotateGearsLoaded);
>}
>
>function RotateGearsLoaded(e:Event):void
>{
>var loaderInfo:LoaderInfo = e.target as LoaderInfo;
>var displayObject:DisplayObject = loaderInfo.content;
>displayObject.width = gearWidths[displayGearsCounter];
>displayObject.height = gearHeights[displayGearsCounter];
> //displayObject.x = - gearWidths[displayGearsCounter];
> //displayObject.y = - gearWidths[displayGearsCounter];
>displayObject.x = 0;
>displayObject.y = 0;
>trace(displayGearsCounter);
>parent_container.addChild(displayObject);
>parent_container.x = 0;
>parent_container.y = 0;
>parent_container.alpha = 1;
>addChild(parent_container);
>var myTimeline:TimelineLite = new
> TimelineLite({useFrames:true});
>myTimeline.append(new TweenMax(parent_container, 1,
> {shortRotation:{rotation:gearAngles[displayGearsCounter]}}));
>}
>}
>
>
>
>
> ___
> 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] How to handle String the best way

2010-07-22 Thread Taka Kojima
Seeing as you have specific abbreviations, I don't understand why Regular
Expressions are entering into this.

You should have the abbreviations and their actual words stored in a
database (maybe an XML doc somewhere), then just compare each one, one a
word to abbreviation basis.

Regular Expressions are not going to work in this scenario unless there are
very specific rules that all possible use cases can conform to.



On Thu, Jul 22, 2010 at 1:28 PM, Karl DeSaulniers wrote:

> Ah yes. That's a great one too.
>
> Karl
>
> Sent from losPhone
>
>
> On Jul 22, 2010, at 3:07 PM, Matt Perkins  wrote:
>
>  Grant Skinner has a great tool for building and testing RegEx
>> http://gskinner.com/RegExr/
>>
>> I've used it a lot lately - i'm new to RegEx and this makes it a lot less
>> intimidating!
>>
>>
>> On 7/22/2010 3:54 PM, Karl DeSaulniers wrote:
>>
>>> Hi guys,
>>> Sorry to barge in, but I found this site to be helpful with RegExp.
>>> Might help you too. Its in javascript, but found it easily translated
>>> into AS.
>>>
>>> http://lawrence.ecorp.net/inet/samples/regexp-intro.php
>>>
>>> Best,
>>>
>>> Karl
>>>
>>>
>>> On Jul 22, 2010, at 2:37 PM, Cor wrote:
>>>
>>>  Thanks again David.

 RegExp are a bit scary for me too. :-)



 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of David
 Hunter
 Sent: donderdag 22 juli 2010 21:14
 To: flashcoders@chattyfig.figleaf.com
 Subject: RE: [Flashcoders] How to handle String the best way


 String.replace() then a regular expression like /[,\.!\?:;\\\/]/g and
 replace it with nothing: "". You'll probably want to check which
 characters
 to remove but remember to use an escape slash for certain characters.
 Haven't tried it but there are some examples and lots of help in the
 docs
 and more online. not that knowledgeable on regular expressions to be
 honest.

  From: c...@chello.nl
> To: flashcoders@chattyfig.figleaf.com
> Subject: RE: [Flashcoders] How to handle String the best way
> Date: Thu, 22 Jul 2010 15:10:46 +0200
>
> Thanks David.
>
> I think you understood exactly what I want.
> The String.split() was also what I had in mind, but I don't know how to
> do
>
 a

> regular expression to strip out any punctuation or unwanted characters.
>
> Do you have an example of such action?
>
> -Original Message-
> From: flashcoders-boun...@chattyfig.figleaf.com
> [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of David
>
 Hunter

> Sent: donderdag 22 juli 2010 14:50
> To: flashcoders@chattyfig.figleaf.com
> Subject: RE: [Flashcoders] How to handle String the best way
>
>
> Not entirely sure if i understand what you want to do, but you could
> use a
> regular expression to strip out any punctuation or unwanted characters.
> String.split() breaks a string into an array of strings by using a
>
 specified

> delimiter which could be a " " space in this situation, so each word is
> an
> element in an array.
> Apply this process to both your strings and you end up with two arrays
>
 which

> should be easy to compare words and cycle through all the elements.
>  Hope
> that helps, but I've probably misunderstood what you want to do! David
>
>  From: c...@chello.nl
>> To: flashcoders@chattyfig.figleaf.com
>> Date: Thu, 22 Jul 2010 09:46:58 +0200
>> Subject: [Flashcoders] How to handle String the best way
>>
>> Hi List,
>>
>> I am trying to find how to best compare 2 strings(word by word).
>> I have 2 texts, one fully written and one abbreviated.
>> The texts have exactly the same amount of words and they are in the
>> same
>> order.
>> So in the text field one word is highlighted.
>> The user has to fill in the abbreviation of the text(word by word).
>> The user fills in his "translation" and ENTERS to confirm.
>> And then the app has to compare the words.
>>
>> He can choose to practice from abbreviation to fully written words or
>>
> vice

> versa.
>>
>> So what is the best way to do this, keeping in mind that special
>>
> characters
>
>> (like .,:;! space) must not be judged.
>>
>> Any idea is welcome.
>>
>> TIA
>> Cor
>>
>>
>>
>> ___
>> Flashcoders mailing list
>> Flashcoders@chattyfig.figleaf.com
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>
> _
> http://clk.atdmt.com/UKM/go/19780/direct/01/
> Do you have a story that started on Hotmail? Tell us
> now__

Re: [Flashcoders] Seamless e-commerce for AS3? Noob question

2010-04-20 Thread Taka Kojima
This isn't really a Flash/ActionScript related question.

There are tons of payment gateways, e.g. authroize.net. All of the ones I
know require backend code to work.

Taka

On Tue, Apr 20, 2010 at 9:40 AM, Steve Klein  wrote:

> Hello, All-
>I don't want to bomb the list with info that's probably been covered
> to death, but I'm having limited success in finding a cart/merchant
> processing solution that will be seamless in an AS3 site.
>
>If anyone could recommend a cart/payment processing solution that
> includes encryption I would be greatly appreciative. The few e-comm sites
> I've done have been either paypal based or driven by Yahoo's merchant
> solutions. I can do nearly all the setup, it's just the cart/ payment
> connectivity that intimidates me.
>
>Please reply directly to me s.kl...@steveklein.cc to keep the list
> clean unless someone else requests similar information.
>
>
> Thank you in advance!
> Steve Klein
>
>
>
>
> ___
> 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] Getting the line index at the caretIndex

2010-04-09 Thread Taka Kojima
I was curious, seems to get pretty ugly logic wise actually, this is the
quickest, easiest solution I came up with:

tf.addEventListener(Event.CHANGE, onChange);
function onChange(event:Event):void{
var caret:int = tf.caretIndex;
 tf.appendText("_");
var line:int = tf.getLineIndexOfChar(caret);
tf.text = tf.text.substr(0, tf.text.length-1);

trace("caret=" + caret + ", line=" + line);
}

It's not pretty obviously, but at least the TextField doesn't actually
render with the "_" for any period of time, so it might not even affect
processing at all if the player isn't trying to redraw it at any point
during the process.

Taka

On Fri, Apr 9, 2010 at 3:58 PM, Taka Kojima  wrote:

> You have to do something like caret-1, and do some logic to detect if the
> current line contains at least one character, and if it doesn't do a line++,
> something along those lines.
>
> My suspicion (which I just confirmed) was that the caret isn't actually
> counted as a character in the textField, therefore when you do
> getLineIndexOfChar(caret) caret is always 1 number higher than the array
> getLineIndexOfChar is referencing to do the lookup.
>
> Taka
>
>
> On Fri, Apr 9, 2010 at 3:36 PM, Steven Sacks wrote:
>
>> I'm trying to get the line index at the caret index in a multiline input
>> TextField, but it doesn't work.  Any ideas why?
>>
>>
>> var tf:TextField; // this is my TextField
>> tf.addEventListener(Event.CHANGE, onChange);
>> function onChange(event:Event):void
>> {
>>var caret:int = tf.caretIndex;
>>var line:int = tf.getLineIndexOfChar(caret);
>>// line is always traces -1
>>trace("caret=" + caret + ", line=" + line);
>> }
>>
>> I typed this:
>>
>> abcd
>> efgh
>> cekjk
>> wejk
>> rhwejk
>> rwehkj
>> werhkj
>> rehwk
>> rewkj
>> rehkj
>> rehkj
>> rewhkj
>> rewhkjgiorehj
>> fdkjs
>> cdshkjfhkj
>>
>> Output is this:
>>
>> caret=0, line=-1
>> caret=1, line=-1
>> caret=2, line=-1
>> caret=3, line=-1
>> caret=4, line=-1
>> caret=5, line=-1
>> caret=6, line=-1
>> caret=7, line=-1
>> caret=8, line=-1
>> caret=9, line=-1
>> caret=10, line=-1
>> caret=11, line=-1
>> caret=12, line=-1
>> caret=13, line=-1
>> caret=14, line=-1
>> caret=15, line=-1
>> caret=16, line=-1
>> caret=17, line=-1
>> caret=18, line=-1
>> caret=19, line=-1
>> caret=20, line=-1
>> caret=21, line=-1
>> caret=22, line=-1
>> caret=23, line=-1
>> caret=24, line=-1
>> caret=25, line=-1
>> caret=26, line=-1
>> caret=27, line=-1
>> caret=28, line=-1
>> caret=29, line=-1
>> caret=30, line=-1
>> caret=31, line=-1
>> caret=32, line=-1
>> caret=33, line=-1
>> caret=34, line=-1
>> caret=35, line=-1
>> caret=36, line=-1
>> caret=37, line=-1
>> caret=38, line=-1
>> caret=39, line=-1
>> caret=40, line=-1
>> caret=41, line=-1
>> caret=42, line=-1
>> caret=43, line=-1
>> caret=44, line=-1
>> caret=45, line=-1
>> caret=46, line=-1
>> caret=47, line=-1
>> caret=48, line=-1
>> caret=49, line=-1
>> caret=50, line=-1
>> caret=51, line=-1
>> caret=52, line=-1
>> caret=53, line=-1
>> caret=54, line=-1
>> caret=55, line=-1
>> caret=56, line=-1
>> caret=57, line=-1
>> caret=58, line=-1
>> caret=59, line=-1
>> caret=60, line=-1
>> caret=61, line=-1
>> caret=62, line=-1
>> caret=63, line=-1
>> caret=64, line=-1
>> caret=65, line=-1
>> caret=66, line=-1
>> caret=67, line=-1
>> caret=68, line=-1
>> caret=69, line=-1
>> caret=70, line=-1
>> caret=71, line=-1
>> caret=72, line=-1
>> caret=73, line=-1
>> caret=74, line=-1
>> caret=75, line=-1
>> caret=76, line=-1
>> caret=77, line=-1
>> caret=78, line=-1
>> caret=79, line=-1
>> caret=80, line=-1
>> caret=81, line=-1
>> caret=82, line=-1
>> caret=83, line=-1
>> caret=84, line=-1
>> caret=85, line=-1
>> caret=86, line=-1
>> caret=87, line=-1
>> caret=88, line=-1
>> caret=89, line=-1
>> caret=90, line=-1
>> caret=91, line=-1
>> caret=92, line=-1
>> caret=93, line=-1
>> caret=94, line=-1
>> caret=95, line=-1
>> caret=96, line=-1
>> caret=97, line=-1
>> caret=98, line=-1
>> caret=99, line=-1
>> caret=100, line=-1
>> caret=101, line=-1
>> caret=102, line=-1
>> caret=103, line=-1
>> caret=104, line=-1
>> ___
>> 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] Getting the line index at the caretIndex

2010-04-09 Thread Taka Kojima
You have to do something like caret-1, and do some logic to detect if the
current line contains at least one character, and if it doesn't do a line++,
something along those lines.

My suspicion (which I just confirmed) was that the caret isn't actually
counted as a character in the textField, therefore when you do
getLineIndexOfChar(caret) caret is always 1 number higher than the array
getLineIndexOfChar is referencing to do the lookup.

Taka

On Fri, Apr 9, 2010 at 3:36 PM, Steven Sacks wrote:

> I'm trying to get the line index at the caret index in a multiline input
> TextField, but it doesn't work.  Any ideas why?
>
>
> var tf:TextField; // this is my TextField
> tf.addEventListener(Event.CHANGE, onChange);
> function onChange(event:Event):void
> {
>var caret:int = tf.caretIndex;
>var line:int = tf.getLineIndexOfChar(caret);
>// line is always traces -1
>trace("caret=" + caret + ", line=" + line);
> }
>
> I typed this:
>
> abcd
> efgh
> cekjk
> wejk
> rhwejk
> rwehkj
> werhkj
> rehwk
> rewkj
> rehkj
> rehkj
> rewhkj
> rewhkjgiorehj
> fdkjs
> cdshkjfhkj
>
> Output is this:
>
> caret=0, line=-1
> caret=1, line=-1
> caret=2, line=-1
> caret=3, line=-1
> caret=4, line=-1
> caret=5, line=-1
> caret=6, line=-1
> caret=7, line=-1
> caret=8, line=-1
> caret=9, line=-1
> caret=10, line=-1
> caret=11, line=-1
> caret=12, line=-1
> caret=13, line=-1
> caret=14, line=-1
> caret=15, line=-1
> caret=16, line=-1
> caret=17, line=-1
> caret=18, line=-1
> caret=19, line=-1
> caret=20, line=-1
> caret=21, line=-1
> caret=22, line=-1
> caret=23, line=-1
> caret=24, line=-1
> caret=25, line=-1
> caret=26, line=-1
> caret=27, line=-1
> caret=28, line=-1
> caret=29, line=-1
> caret=30, line=-1
> caret=31, line=-1
> caret=32, line=-1
> caret=33, line=-1
> caret=34, line=-1
> caret=35, line=-1
> caret=36, line=-1
> caret=37, line=-1
> caret=38, line=-1
> caret=39, line=-1
> caret=40, line=-1
> caret=41, line=-1
> caret=42, line=-1
> caret=43, line=-1
> caret=44, line=-1
> caret=45, line=-1
> caret=46, line=-1
> caret=47, line=-1
> caret=48, line=-1
> caret=49, line=-1
> caret=50, line=-1
> caret=51, line=-1
> caret=52, line=-1
> caret=53, line=-1
> caret=54, line=-1
> caret=55, line=-1
> caret=56, line=-1
> caret=57, line=-1
> caret=58, line=-1
> caret=59, line=-1
> caret=60, line=-1
> caret=61, line=-1
> caret=62, line=-1
> caret=63, line=-1
> caret=64, line=-1
> caret=65, line=-1
> caret=66, line=-1
> caret=67, line=-1
> caret=68, line=-1
> caret=69, line=-1
> caret=70, line=-1
> caret=71, line=-1
> caret=72, line=-1
> caret=73, line=-1
> caret=74, line=-1
> caret=75, line=-1
> caret=76, line=-1
> caret=77, line=-1
> caret=78, line=-1
> caret=79, line=-1
> caret=80, line=-1
> caret=81, line=-1
> caret=82, line=-1
> caret=83, line=-1
> caret=84, line=-1
> caret=85, line=-1
> caret=86, line=-1
> caret=87, line=-1
> caret=88, line=-1
> caret=89, line=-1
> caret=90, line=-1
> caret=91, line=-1
> caret=92, line=-1
> caret=93, line=-1
> caret=94, line=-1
> caret=95, line=-1
> caret=96, line=-1
> caret=97, line=-1
> caret=98, line=-1
> caret=99, line=-1
> caret=100, line=-1
> caret=101, line=-1
> caret=102, line=-1
> caret=103, line=-1
> caret=104, line=-1
> ___
> 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] What good is a Controller?

2010-03-31 Thread Taka Kojima
>> Hey, if you're doing well with AS2, there's nothing wrong with that.
>> It's not going away for a long time.

Jason is right, and to his point:

The interactive industry is probably one of the the fastest changing
industries in the world. If you aren't willing to change (and I am not
saying you are not willing Karl), pick a different career.

As web developers, competence, being able to quickly learn and pick up on
new technologies, etc. go hand in hand with being good at what we do. Sure
that could be said for any field of work, but I think it's extremely
relevant for this field.

AS2 will be completely dead and irrelevant in 3 years, in 10 years from now
Flash Player will probably not even support AS 2 content, if Flash Player
itself is still relevant then. Talking about the web's future 10 years from
now is generally not a good idea, so I am not going to go down that path.


On Wed, Mar 31, 2010 at 5:27 PM, Merrill, Jason <
jason.merr...@bankofamerica.com> wrote:

> Hey Karl - a few more things - check out the Migration Cheat Sheet for
> AS3 here:
>
> http://actionscriptcheatsheet.com/blog/quick-referencecheatsheet-for-act
> ionscript-20/
> (Some of the other cheat sheets will be useful too.)
>
> Read through that and you'll start to get comfortable with the changes.
> It can seem painful at first, but start slow - for example, create a
> test project where you use AS3 to insert a Textfield on the screen and
> set a value on it - then create a button that removes it or something.
> Pretty soon you'll be off and running - and we'll be here to help.
>
>
>
>
> Jason Merrill
>
> Bank of  America  Global Learning
> Learning & Performance Solutions
>
> Join the Bank of America Flash Platform Community  and visit our
> Instructional Technology Design Blog
> (note: these are for Bank of America employees only)
>
>
>
>
>
>
> -Original Message-
> From: flashcoders-boun...@chattyfig.figleaf.com
> [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl
> DeSaulniers
> Sent: Wednesday, March 31, 2010 6:08 PM
> To: Flash Coders List
> Subject: Re: [Flashcoders] What good is a Controller?
>
> I tend to agree with Jason here, I am a freelancer and I have missed
> out on a lot of jobs because I am not an AS3 developer.
> Your probably right on the ease of use and the functionality of AS3
> being better, otherwise what would be the use of creating AS3.
>
> Again, thanks for all your comments.
> I am going to try to migrate as soon as I can.
> I know its just an amount of getting into it and getting it done.
>
> Best Regards,
>
> Karl DeSaulniers
>
>
>
> On Mar 31, 2010, at 5:01 PM, Merrill, Jason wrote:
>
> >> Hey, if you're doing well with AS2, there's nothing wrong with that.
> >> It's not going away for a long time.
>
> I disagree with that - what happens when you lose your job and have to
> put your resume out there?  And IMO, it's nearly almost gone away
> anyway.  Sure Flash player supports it still, but most developers have
> moved on.  We recently hired a Flash developer as you know, and if the
> candidates didn't have AS3 on their resume, they were immediately
> discounted as a viable candidate.
>
> >> COBOL used to be the dominant language for business apps. I haven't
> >> programmed in COBOL for 25 years, but I still see COBOL gigs posted.
>
> Because there were still lots of huge systems built in that language -
> Flash apps are much more short lived than that, and while there may
> still be a few AS2 jobs out there, they are increasingly becoming fewer
> and fewer by the day. Besides, just because there are a small number
> jobs out there for COBOL doesn't mean you should continue to focus on
> that as a skill and bet your future career on it. I'd much rather be
> fluent in Phyton, C# or Java than COBOL any day.
>
> >> By the time you run out of AS2 gigs, you might be old enough to
> retire,
>
> I think it will happen much quicker than that - depending on how old you
> are though I suppose.  I guess I don't see AS2 being as long lived as
> you do.
>
>
> Jason Merrill
>
> Bank of  America  Global Learning
> Learning & Performance Solutions
>
> Join the Bank of America Flash Platform Community  and visit our
> Instructional Technology Design Blog
> (note: these are for Bank of America employees only)
>
>
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Karl DeSaulniers
> Design Drumm
> http://designdrumm.com
>
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http

Re: [Flashcoders] RE: Recursive and e:Event

2010-03-29 Thread Taka Kojima
Aside from the typos, anonymous functions are the devil.

On Mon, Mar 29, 2010 at 8:09 AM, Merrill, Jason <
jason.merr...@bankofamerica.com> wrote:

> >>xmlLoader.addEventListener(Event.COMPLETE, function(e:event):viod {
>>> var xml:XML = new XML)e.target.data);
> >>function(xml);
> >>});
>
> Wow, that's nasty nasty nasty... and doesn't give you ANY compiler
> errors eh? :)
>
>
> Jason Merrill
>
> Bank of  America  Global Learning
> Learning & Performance Solutions
>
> Join the Bank of America Flash Platform Community  and visit our
> Instructional Technology Design Blog
> (note: these are for Bank of America employees only)
>
>
>
>
>
>
> -Original Message-
> From: flashcoders-boun...@chattyfig.figleaf.com
> [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Lehr,
> Theodore
> Sent: Monday, March 29, 2010 7:47 AM
> To: Flash Coders List
> Subject: [Flashcoders] RE: Recursive and e:Event
>
> sorry - jumped the gun - I worked it out with:
>
> xmlLoader.addEventListener(Event.COMPLETE, function(e:event):viod {
> var xml:XML = new XML)e.target.data);
> function(xml);
> });
>
> 
> From: Lehr, Theodore
> Sent: Monday, March 29, 2010 7:31 AM
> To: Flash Coders List
> Subject: Recursive and e:Event
>
> I am having an issue trying to recursively go through some xml...
>
> When the xml was local (i.e. var newXml:XML =  ..;) then a
> recursive function like:
>
> function (parseXML(_xml:*) {
>   ...
>   parseXML(ixml);
> }
>
> worked fine
>
> but when I try to pull it in from another file via:
>
> xmlLoader.load..
> xmlLoader.addEventListener. {
>   parseXML(e);
> }
>
> function (parseXML(e:Event) {
>   ...
>   parseXML(ixml);
> }
>
> It works fine the first time through and then I get an error on the
> first recursive call because ixml is not an e:Event
>
> I need to find a way to get around this can I call the function
> without e:Event?
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Events can be tedious, general thoughts on best practice?

2010-03-24 Thread Taka Kojima
You bring up some valid points, however some of them are irrelevant for this
example, i.e. multiple listeners.

I could be a minority, but I don't think I am when I say that I have never
used multiple listeners for when I load in an XML file.

Secondly, if I were to implement events for this XMLLoader class, I would
most likely write a custom event class, which is even more work and I don't
feel like it is necessary.

The reason I say I'd write a custom event class is, let's say I wanted to
implement caching into my XMLLoader class, I can't use the Event.COMPLETE
event anymore as the second time I make the request it won't even call a
URLLoader, as it's reading from an array/dictionary/vector stored in the
class to grab the content.

I totally agree with you on the familiarity/consistency point, it makes
working with others a lot easier.

The other option is as3-signals, which I'm looking into and looks rather
promising.


On Wed, Mar 24, 2010 at 1:02 PM, Mark Winterhalder  wrote:

> On Wed, Mar 24, 2010 at 7:03 PM, Taka Kojima  wrote:
> > I'm curious as to other people's thoughts on
> > this in terms of good/bad practice and what the pros/cons to this
> approach
> > might be.
>
> My thoughts are that it's OK for the very common cases which don't
> need the flexibility of events.
>
> Advantages of events:
>
>  * multiple listeners
>  * one listener for multiple targets/types
>  * progress events etc.
>  * you'll have events all over your project anyway, period.
>  * it's what other coders are familiar with
>
> The last one's important if other devs /might/ have to work with your
> code. For this it will only take me a minute to look up "that strange
> loader class I don't know", but if you use too many of those it adds
> up, and at some point I won't want to play with you no more.
>
> Personally, I'll stick with events, and I don't mind them at all.
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Events can be tedious, general thoughts on best practice?

2010-03-24 Thread Taka Kojima
I have an XMLLoader class that I wrote that I've been using to load XML
files.

--
 public class XMLLoader{

/**
* Load an XML file
*
* @param url The path to the XML file.
* @param onComplete The function to call when the XML file loads, passes
back an argument of type StyleSheet
* @param onError The function to call (defaults to null) if the load errors
out, passes back an IOErrorEvent object.
*/
 public static function load(url:String, onComplete:Function,
onError:Function = null):void{
var _xml:XML = null;
var _xmlURL:URLRequest = new URLRequest(url);
var _xmlLoader:URLLoader = new URLLoader(_xmlURL);

_xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
_xmlLoader.addEventListener(IOErrorEvent.IO_ERROR, xmlError);

function xmlLoaded(e:Event):void{
 _xmlLoader.removeEventListener(Event.COMPLETE, xmlLoaded);
_xmlLoader.removeEventListener(IOErrorEvent.IO_ERROR, xmlError);
 if(onComplete is Function){
var xml:XML = XML(_xmlLoader.data);
onComplete(xml);
}
}
 function xmlError(e:IOErrorEvent):void{
 _xmlLoader.removeEventListener(Event.COMPLETE, xmlLoaded);
_xmlLoader.removeEventListener(IOErrorEvent.IO_ERROR, xmlError);

if(onError is Function){
onError(e);
}
}
}
}
--

As you can see it doesn't do too much, but writing the following every time
I wanted to load an XML file was getting tedious:

import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.net.URLRequest;
import flash.net.URLLoader;

var xmlLoader:URLLoader = new URLLoader(new
URLRequest("path/to/xmlFile.xml"));

xmlLoader.addEventListener(Event.COMPLETE, onXMLLoaded);
xmlLoader.addEventListener(IOErrorEvent.IO_ERROR, onXMLError);

function onXMLLoaded(e:Event):void{

}

Being able to call

XMLLoader.load("path/to/xmlFile.xml", onXMLLoaded, onXMLError);

is so much better, the question is I am no longer using events, and handling
the event listeners within the XMLLoader class and passing functions to the
class to call upon said events.I'm curious as to other people's thoughts on
this in terms of good/bad practice and what the pros/cons to this approach
might be.

Just want to hear all your thoughts.

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


Re: [Flashcoders] External font loading - No shared libraries

2010-02-18 Thread Taka Kojima
Unlike in AS2, you don't have to use runtime shared libraries for AS3 to
load fonts.

It's simple, all you do is embed the fonts in a swf and load that swf in
using a loader. Once the loader loads the swf, all fonts will be available
for use.

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/text/Font.html

One thing to note, which is rather annoying is that if you are using that
font anywhere else in your FLA on the timeline, the fonts will not work
properly after you load them.

- Taka

On Thu, Feb 18, 2010 at 10:13 AM, mika  wrote:

> Same question, 3 years after, anyone got a tip ? as3 please
>
> thanks
> mika
>
> On Mon, Jun 4, 2007 at 17:11, Daniel Gregório  >wrote:
>
> > Does anybody has an ideia of how to load external fonts in ttf? or
> > something
> > else instead of shared libraries?
> >
> > thank you very much,
> >
> >
> > --
> > Daniel Gregório
> > Adobe Certified Professional
> > ___
> > Flashcoders@chattyfig.figleaf.com
> > To change your subscription options or search the archive:
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> > Brought to you by Fig Leaf Software
> > Premier Authorized Adobe Consulting and Training
> > http://www.figleaf.com
> > http://training.figleaf.com
> >
> ___
> Flashcoders 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] XMLList question

2010-02-05 Thread Taka Kojima
Yep. If you control the output of the attributes and know for a fact that
they won't have special characters, then you can use attributes, for
instance id's, sequence fields, file paths, etc. but for anything that is
user generated where you don't know whether or not there could be special
characters (even if you don't think there would be), it's best to go the
CDATA route.

And yes, I have learned the hard way, you know where 1 year down the line,
all of a sudden the entire application breaks and isn't displaying any
data... quite a nightmare.

- Taka

On Fri, Feb 5, 2010 at 10:33 AM, Jared  wrote:

> My rule of thumb is anything that will be used for display text is in CDATA
> tags, not attributes
>
> Sent from my iPhone
>
>
> On Feb 4, 2010, at 8:09 AM, Dave Watts  wrote:
>
>  I always use CDATA tags for text in nodes where special characters might
>>> exist.
>>>
>>
>> I really strongly second this. This has been the cause of more
>> problems I've seen than I can count. You never know what kind of
>> characters you might be getting from a database query.
>>
>> Dave Watts, CTO, Fig Leaf Software
>> http://www.figleaf.com/
>> http://training.figleaf.com/
>>
>> Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
>> GSA Schedule, and provides the highest caliber vendor-authorized
>> instruction at our training centers, online, or onsite.
>> ___
>> Flashcoders mailing list
>> Flashcoders@chattyfig.figleaf.com
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] E4X, it's just not my day.

2010-02-05 Thread Taka Kojima
var artData:XML = new XML(
   
   an artist
   He sucks
   She rocks
   
);


var lastName="Agrafiotis";

// undefined
var a = artData.bios.artistBio.(@s==lastName);

// correctly finds the Peter Agrafiotis node
var b = artData.bios.*.(@s==lastName);

trace(a);
trace(b);

this works for me.

On Fri, Feb 5, 2010 at 10:06 AM, Mendelsohn, Michael <
michael.mendels...@fmglobal.com> wrote:

> Sorry folks, that was a typo in the post.  In my Flash file, it is indeed
> correctly formed XML.
>
> var e = artData.bios.artistBio.(@s==lastName);
>
> var d = artData.bios.*.(@s==lastName);
>
> There is something definitely weird going on in my code, because this is a
> simple E4X statement.  Seriously, shouldn't e and d both return the one node
> that fits that criteria?  In my class, e returns undefined, and d correctly
> returns it.
>
> - MM
>
>
> -Original Message-
> From: flashcoders-boun...@chattyfig.figleaf.com [mailto:
> flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Jer Brand
> Sent: Friday, February 05, 2010 12:16 PM
> To: Flash Coders List
> Subject: Re: [Flashcoders] E4X, it's just not my day.
>
> Fixing that, your code works (I just added explicit var types).
>
> var artData:XML = new XML(
>   
>s="Agrafiotis">an artist
>   He
> sucks
>s="Agrafiotis">She rocks
>   
>);
>
>
>var lastName:String="Agrafiotis";
>
>var a:XMLList =
> artData.bios.artistBio.(@s==lastName);
>trace(a.toXMLString())
>
>var b:XMLList = artData.bios.*.(@s==lastName);
>trace(b.toXMLString()) ;
>
>
> OUTPUTS:
>
> an artist
> She rocks
> an artist
> She rocks
>
>
> Jer
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] I Must Be Asking This Question Wrong...

2010-02-02 Thread Taka Kojima
+1 to banning.

Although, I am an active AS3 developer, unlike Bill.

beno generates way too much garbage to have to sort through when I actually
want to look through the topics and see if there is anybody I can help with
my knowledge, or if I can learn anything from the things people have been
discussing.

beno's questions are soo simplistic and quite clearly manifest general
laziness on his part of not actually trying to learn the fundamentals and
not doing proper research and discovery as needed.

He's like a bad framework, way too much bloat at way too high a cost.
Time to part ways, he clearly annoys a lot of people and he doesn't
contribute anything productive to this list, so why keep him around?

- Taka

On Tue, Feb 2, 2010 at 6:41 PM, Bill Napier  wrote:

> Ok, I give, reading beno's posts have become something of a guilty
> pleasure.   Steven's hamster computer comment actually did make me laugh out
> loud.
>
> Dave, I wish that you would just ban beno from the list. Clearly, while he
> is generating a lot of traffic, it's all just OT crap.
>
> As a lurker, I just use this list to populate my google account as a
> repository for Flash coding searches. I use Flash rarely. I spend most of my
> time doing ASP .NET (c#) coding.
>
> If I conducted myself like beno on any list, I would expect to be banned
> and I would deserve to be banned.
>
> --
> Bill Napier
>
>
> On Feb 2, 2010, at 4:47 PM, "Cor"  wrote:
>
>  That's a buck to me!
>>
>> -Original Message-
>> From: flashcoders-boun...@chattyfig.figleaf.com
>> [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Gustavo
>> Duenas
>> Sent: dinsdag 2 februari 2010 22:41
>> To: Flash Coders List
>> Subject: Re: [Flashcoders] I Must Be Asking This Question Wrong...
>>
>> from an artist to another, explain me what are you trying to do in
>> plain english and maybe the people in the list would start seeing
>> things your way...I don't know, but when I ask for help (a lot of
>> times in the past, present and the future) I've always explained what
>> am I looking to obtain first, then I submit the code for
>> consideration, that helps me a lot...my two cents.
>>
>> Gus
>> "call me pussy or moron I use to trace , but if you want to teach me
>> breackpoints, no problem, i'll bring my sharpest pencil to defend
>> myself"
>> ;)
>>
>>
>>
>>
>> On Feb 2, 2010, at 1:08 PM, beno - wrote:
>>
>>  Frankly I'm glad things have slowed down. Let me play Devil's
>>> Advocate and
>>> state explicitly I don't want you to do my work for me. I want you
>>> to help
>>> me understand what it is I need to do. This morning, two very kind
>>> people
>>> reached out to help me simultaneously. Their methodology was
>>> completely
>>> different the one from the other. Their attitude was stellar but their
>>> delivery beyond what they should have offered. Make_me_work. I'm not
>>> afraid
>>> of working. I like it. I need to learn this for myself.
>>> Suggest...and make
>>> me sweat. As it was, I was doing everything I could to keep up with
>>> the two
>>> of you! Now that things have calmed down, I've had a chance to
>>> review your
>>> suggestions and try to make sense of the vis-a-vis my code.
>>>
>>> One lister commented I'm the most expensive programmer on the
>>> planet. I
>>> laughed my a$$ off. It may be true. However, it's equally true I am
>>> sincerely trying my best. Again, I'm an artist, and positively
>>> gifted at
>>> that. (Or, as I would say, I'm really good at listening to the
>>> Muses. I'm
>>> not the artist. They are.) This will be incorporated into my art, so
>>> it's
>>> more than just a revenue generator. But as an artist, I really have
>>> a very
>>> difficult time thinking like a left-brain programmer. Please believe
>>> me when
>>> I tell you I'm doing the very best I can. I would never abuse your
>>> help,
>>> even though it may seem that way to some of you left-brainers. If
>>> you could
>>> walk a mile in my moccasins, you would have an entirely different
>>> perspective on this matter, I assure you.
>>>
>>> Lastly, before I get into the code, let me state that the Moock book
>>> should
>>> arrive by Friday. Hopefully I'll be able to answer most of my own
>>> questions
>>> by then, which--believe it or not--is what I would prefer to do. I
>>> don't
>>> want to be the "most expensive programmer in the world." I want to
>>> do it
>>> myself, at least as much as I possibly can. I want your respect, not
>>> your
>>> charity.
>>>
>>> So, the code. Working with Glen Pike's suggestions of keeping it all
>>> in the
>>> same class, I've refined my code to this:
>>>
>>> package
>>> {
>>>  import flash.events.Event;
>>>  import flash.events.ProgressEvent;
>>>  import flash.events.Event;
>>>  import flash.events.MouseEvent;
>>>  import flash.display.MovieClip;
>>>  import com.greensock.*;
>>>  import com.greensock.easing.*;
>>>  public class Main2 extends MovieClip
>>>  {
>>> trace('hi');
>>> public var myThumb:CloseThumb;
>>> private var counter:

Re: [Flashcoders] XMLList question

2010-02-02 Thread Taka Kojima
whoops, sorry wrong thread :)

On Tue, Feb 2, 2010 at 5:38 PM, Taka Kojima  wrote:

> I'm siding with Steven on this one.
>
> Beno seems to be the worst offender, but it's not just him. It's quite
> clear that he doesn't understand the fundamentals and basics -- that's his
> main problem.
>
> He's working off of a very shallow and glib understanding of things, thus
> it's a recurring issue where he comes to the list and asks for help whenever
> he hits a wall.
>
> Asking for help is not bad, asking for help on questions that you really
> should know the answer to and if you don't you should figure it out on your
> own, is just lazy. Pick up a book on Actionscript and OOP fundamentals and
> then you can start coming to the list to ask for help.
>
>
> On Tue, Feb 2, 2010 at 5:21 PM, Steven Sacks wrote:
>
>> As a rule, I only put string values that never contain special characters
>> in attributes, otherwise you end up with XML validation errors (like putting
>> ampersands in attributes).
>>
>> Also, I generally put parsing code inside the constructor of the VO class
>> (well, I call deserialize() because code inside constructors are
>> interpreted).
>>
>> public class ValueObject
>> {
>>public var foo:String;
>>public var bar:String;
>>
>>public function ValueObject(node:XML)
>>{
>>deserialize(node);
>>}
>>private function deserialize(node:XML):void
>>{
>>foo = no...@foo;
>>bar = node.bar;
>>}
>> }
>>
>> There are exceptions to this rule, but they're rare.
>>
>> It makes it really easy to share VOs between multiple service classes when
>> the parsing logic is contained with the VO instead of each service class
>> (assuming that the xml is homogenized).
>>
>> ___
>> 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] XMLList question

2010-02-02 Thread Taka Kojima
I'm siding with Steven on this one.

Beno seems to be the worst offender, but it's not just him. It's quite clear
that he doesn't understand the fundamentals and basics -- that's his main
problem.

He's working off of a very shallow and glib understanding of things, thus
it's a recurring issue where he comes to the list and asks for help whenever
he hits a wall.

Asking for help is not bad, asking for help on questions that you really
should know the answer to and if you don't you should figure it out on your
own, is just lazy. Pick up a book on Actionscript and OOP fundamentals and
then you can start coming to the list to ask for help.


On Tue, Feb 2, 2010 at 5:21 PM, Steven Sacks wrote:

> As a rule, I only put string values that never contain special characters
> in attributes, otherwise you end up with XML validation errors (like putting
> ampersands in attributes).
>
> Also, I generally put parsing code inside the constructor of the VO class
> (well, I call deserialize() because code inside constructors are
> interpreted).
>
> public class ValueObject
> {
>public var foo:String;
>public var bar:String;
>
>public function ValueObject(node:XML)
>{
>deserialize(node);
>}
>private function deserialize(node:XML):void
>{
>foo = no...@foo;
>bar = node.bar;
>}
> }
>
> There are exceptions to this rule, but they're rare.
>
> It makes it really easy to share VOs between multiple service classes when
> the parsing logic is contained with the VO instead of each service class
> (assuming that the xml is homogenized).
>
> ___
> 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] OT: finding where a web site lives

2010-01-11 Thread Taka Kojima
you can also just ping the domain..

ping domain.com

it will return the IP

On Mon, Jan 11, 2010 at 11:14 AM, Nathan Mynarcik wrote:

> You can search WhoIs to get info on the domain. www.whois.net
>
>
> --Original Message--
> From: Lehr, Theodore
> Sender: flashcoders-boun...@chattyfig.figleaf.com
> To: Flash Coders List
> ReplyTo: Flash Coders List
> Subject: [Flashcoders] OT: finding where a web site lives
> Sent: Jan 11, 2010 1:00 PM
>
> I am helping take over a web site formy HOA. Is there a way to fuind out
> where a web site lives? I can not tell if it is on server or where it is...
> hope this makes sense...
>
>
>
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
>
> Nathan Mynarcik
> Interactive Web Developer
> nat...@mynarcik.com
> 254.749.2525
> www.mynarcik.com
> ___
> 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] detect and remove listeners

2010-01-06 Thread Taka Kojima
Yeah, that is the best way... that way you can also properly make sure you
handle removing all of them when you no longer need an object.

You can either create a helper class, with static methods or extend
MovieClip or Sprite and have all of your classes extend from the new class.

Store everything in a multidimensional array and you're good to go, then you
can create a removeAllListeners() method that saves a lot of time and
headaches for garbage collection purposes.

This is how I handle event listeners for major application components and it
has worked very well thus far.

- Taka

On Wed, Jan 6, 2010 at 3:35 AM, Karl DeSaulniers wrote:

> Maybe create a class or function that applies and removes the listeners?
>
> Karl
>
>
>
> On Jan 6, 2010, at 5:21 AM, Henrik Andersson wrote:
>
>  ktt wrote:
>>
>>> Hello,
>>>
>>> What is the best method to iterate through MovieClip children, check if
>>> they have listeners and if they have - remove them?
>>>
>>>  It is not possible to get a list of the listeners. This means that you
>> can not remove them. You can however detect if there is any at all for a
>> given event.
>> ___
>> Flashcoders mailing list
>> Flashcoders@chattyfig.figleaf.com
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>
> Karl DeSaulniers
> Design Drumm
> http://designdrumm.com
>
>
> ___
> 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] hen's teeth...

2010-01-04 Thread Taka Kojima
Anybody I know that I consider good at programming in a certain language, is
proficient in at least 2 other languages as well... kinda goes without
saying, but most programmers do know more than one language. After all, it's
not necessarily the language that makes a developer, it's the conceptual
understanding of everything else, design patterns, syntax, best practices,
etc.

In my experience, anybody that only knows ActionScript, is not that great at
it and I would not consider them developers.

- Taka

On Mon, Jan 4, 2010 at 3:08 PM, Dave Watts  wrote:

> > So would you say it would be advantageous for aspiring Flash programers
> to
> > learn C#?
> > Or leave it alone, not needed? I hear they are very similar as well.
> > I was wondering what the benefits would be.
>
> AS3 and C# are very similar, yes.
>
> I think it's advantageous for aspiring programmers to learn more than
> one language, especially if one of the languages they're learning is
> domain-specific, like AS3. I think C# would be a fine choice for an
> alternate language to learn, although it might actually be better to
> choose something that isn't so similar, like Python.
>
> 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] (x,y) position of selectedItem in a list - AS3

2010-01-04 Thread Taka Kojima
So I did some object introspection and found that List (or SelectableList
rather, which is the class List extends), has a protected property called
"list" which has all the list item DisplayObjects, so what you will have to
do is create a custom component that extends list and then accesses that
protected "list" property, using list.getChildAt(selectedIndex)

- Taka

On Mon, Jan 4, 2010 at 2:48 PM, Paul Andrews  wrote:

> Taka Kojima wrote:
>
>> You will have to use localToGlobal, but first things first...
>>
>> You are correct, selectedItem returns an Object, not a DisplayObject,
>> however I am pretty sure you can do
>>
>> list.getChildAt(list.selectedIndex) to get the display object, and then go
>> from there.
>>
>>
> That didn't seem to work - I don't think there's a direct relationship
> between the components that make up the list and the list elements
> themselves.
>
> Thanks for the suggestion though Taka.
>
> Paul
>
>  - Taka
>>
>> On Mon, Jan 4, 2010 at 12:44 PM, Paul Andrews  wrote:
>>
>>
>>
>>> Cor wrote:
>>>
>>>
>>>
>>>> Not sure, but have you looked into : localToGlobal?
>>>>
>>>>
>>>>
>>>>
>>> Yes, I did, but no luck. I will check again.
>>>
>>> Paul
>>>
>>>
>>>
>>>> -Original Message-
>>>> From: flashcoders-boun...@chattyfig.figleaf.com
>>>> [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul
>>>> Andrews
>>>> Sent: maandag 4 januari 2010 21:17
>>>> To: Flash Coders List
>>>> Subject: [Flashcoders] (x,y) position of selectedItem in a list - AS3
>>>>
>>>> AS3:
>>>>
>>>> Is it possible to find the (x,y) position on the stage of a selectedItem
>>>> in a list?
>>>>
>>>> The selectedItem property returns an Object and I don't think it's
>>>> DisplayObject.
>>>>
>>>> Any suggestions?
>>>>
>>>> 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] (x,y) position of selectedItem in a list - AS3

2010-01-04 Thread Taka Kojima
You will have to use localToGlobal, but first things first...

You are correct, selectedItem returns an Object, not a DisplayObject,
however I am pretty sure you can do

list.getChildAt(list.selectedIndex) to get the display object, and then go
from there.

- Taka

On Mon, Jan 4, 2010 at 12:44 PM, Paul Andrews  wrote:

> Cor wrote:
>
>> Not sure, but have you looked into : localToGlobal?
>>
>>
> Yes, I did, but no luck. I will check again.
>
> Paul
>
>> -Original Message-
>> From: flashcoders-boun...@chattyfig.figleaf.com
>> [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul
>> Andrews
>> Sent: maandag 4 januari 2010 21:17
>> To: Flash Coders List
>> Subject: [Flashcoders] (x,y) position of selectedItem in a list - AS3
>>
>> AS3:
>>
>> Is it possible to find the (x,y) position on the stage of a selectedItem
>> in a list?
>>
>> The selectedItem property returns an Object and I don't think it's
>> DisplayObject.
>>
>> Any suggestions?
>>
>> Paul
>> ___
>> Flashcoders mailing list
>> Flashcoders@chattyfig.figleaf.com
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>> No virus found in this incoming message.
>> Checked by AVG - www.avg.com Version: 9.0.725 / Virus Database:
>> 270.14.124/2599 - Release Date: 01/04/10
>> 09:24:00
>>
>> ___
>> Flashcoders mailing list
>> Flashcoders@chattyfig.figleaf.com
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>>
>>
>
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Loading local files with query strings

2009-09-14 Thread Taka Kojima
Appending arguments to the end of a swf file acts the same as setting
FlashVars.

So, I take it you are trying to pass an id to the loaded in sub swf?

Another way to go about it would be to wait until it loads, and then access
the contents of the subloaded swf and set variables that way.

Or you can just use a static var like MyApp.varName = value; and then the
subloaded swf can check for MyApp.varName

- Taka

On Mon, Sep 14, 2009 at 11:48 AM, Ian Thomas  wrote:

> Don't use query strings?
>
> Seriously - local file names on files systems don't take query
> strings. You don't have any files called C:\windows\test.exe?id=33, do
> you?
>
> To make a query string work, you need to route the call through an HTTP
> server.
>
> Sounds like you're trying to avoid caching? But I'm not clear why
> you'd want to avoid caching a local, non-dynamic file...
>
> Ian
>
> On Mon, Sep 14, 2009 at 7:16 PM, Álvaro Saraiva  wrote:
> > Hi everyone,
> > I have a strange problem loading external assets from local files with
> > Loader() Class in AS3.
> > If i use query string in the file name, the asset don't loads.
> >
> > This code doesnt load the swf file inside a class
> > this.mySWFLoader = new Loader();
> > this.mySWFLoader.contentLoaderInfo.addEventListener(Event.INIT,
> > displaySwfContainer );
> > this.mySWFLoader.load(new URLRequest("my_swf.swf?id=33"));
> >
> > if i dont use the '?id=33' it works.
> >
> > Any suggestions?
> > Thanxs in advance,
> > Álvaro
> >
> >
> >
> >
> > ___
> > Flashcoders mailing list
> > Flashcoders@chattyfig.figleaf.com
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
>
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Dynamic e4x searches...

2009-09-09 Thread Taka Kojima
Hey Glen,

It's quite simple actually, just use [brackets]. Look at the below code:

var xml:XML = 
  
1
system_management

  
1
status
  

  
  
17
sequence_management

  
1
status
  
  
2
play
  
  
3
stop
  

  
 


 var nodeName:String = "name";
 trace(xml.object[nodeName]);


And if you want to use dynamic attributes, you do something like:

trace(xml.object.(@[nodeName]=="value"));

- Taka

On Wed, Sep 9, 2009 at 5:05 AM, Glen Pike  wrote:

> Hi,
>
>   I am having some issues with e4x filtering when I try and use a "dynamic"
> element in my expressions...
>
>   Using the XML below (somewhat truncated) I am trying to match either the
> "id" or the "name" depending on the variable type passed in:
>
>  private function _subscriberEventNameFromIds(objId:* = 0, funcId:int = 0,
> is_func:Boolean = true):String {
>   var objName:String;
>   var funcName:String;
>   //_subscriptionList contains the XML below...
>   //
>   var obj:XMLList;
>   var idx:String = "name";
> if(objId is int) {
>   idx = "id";
>
>   }
>//The following expression does not work, I cannot use idx
> "dynamically"..
>   obj = _subscriptionList.object.(child(idx) == objId);
>//..., instead I have to do the following.
>/*
>   if(objId is int) {
>   idx = "id";
>   obj = _subscriptionList.object.(child("id") == int(objId));
>   } else {
>   obj = _subscriptionList.object.(child("name") ==
> String(objId));
>   }
>*/
>  }
>
>   Does anyone know if /how I can do this dynamically?
> Glen
>
>   
>   
> 1
> system_management
> 
>   
> 1
> status
>   
> 
>   
>   
> 17
> sequence_management
> 
>   
> 1
> status
>   
>   
> 2
> play
>   
>   
> 3
> stop
>   
> 
>   
>  
> ___
> 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] Re: accessing a text node inside another node in a XMLList

2009-08-28 Thread Taka Kojima
First off, XML can only have one root node, thus you're probably getting
some weird errors.

If you enclose all of your xml within , you should be fine.

- Taka

On Fri, Aug 28, 2009 at 11:53 AM, Isaac Alves  wrote:

> I´ve realized actually that flash recognizes the XMLList as having 9
> children, ignoring the tags 
>
> when I was expecting three children , each one of them with also 3
> children ( the tags ).
>
> Why?
>
> 2009/8/28 Isaac Alves :
> > Hello list,
> >
> > I have the following XML ( i get that by tracing
> > "tabsContentSlideshow" which is a XMLList.
> > I-d like to use something like
> >
> > tabsContentSlideshow[slide][1]
> >
> > slide is an integer, so for example, if the slide 2 is showing, this
> > statement would return the first node  inside the second node
> > , that is:
> >
> >  SLIDE 2
> >
> > but it doesn´t work like that.
> > how could I do it ??
> >
> > thanks in advance !
> >
> >
> > 
> >  CONECTE-SE
> >  Bem-vindo ao Conecte-se!
> >  Aqui você encontra vida! Grupos pequenos,
> > células, que se reúnem semanalmente. Nós oramos e desejamos que você
> > desenvolva bons relacionamentos, um propósito, envolvimento e encontre
> > alegria. Vamos servir ao Senhor juntos!
> > 
> > 
> >  SLIDE 2
> >  Bem-vindo ao slide 2
> >  Aqui você encontra vida! Grupos pequenos,
> > células, que se reúnem semanalmente. Nós oramos e desejamos que você
> > desenvolva bons relacionamentos, um propósito, envolvimento e encontre
> > alegria. Vamos servir ao Senhor juntos!
> > 
> > 
> >  SLIDE 3
> >  Bem-vindo ao slide 3
> >  Aqui você encontra vida! Grupos pequenos,
> > células, que se reúnem semanalmente. Nós oramos e desejamos que você
> > desenvolva bons relacionamentos, um propósito, envolvimento e encontre
> > alegria. Vamos servir ao Senhor juntos!
> > 
> >
>
> ___
> 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] accessing a text node inside another node in a XMLList

2009-08-28 Thread Taka Kojima
tabsContentSlideshow.children()[slide].children()[1]

2009/8/28 Isaac Alves 

> Hello list,
>
> I have the following XML ( i get that by tracing
> "tabsContentSlideshow" which is a XMLList.
> I-d like to use something like
>
> tabsContentSlideshow[slide][1]
>
> slide is an integer, so for example, if the slide 2 is showing, this
> statement would return the first node  inside the second node
> , that is:
>
>  SLIDE 2
>
> but it doesn´t work like that.
> how could I do it ??
>
> thanks in advance !
>
>
> 
>  CONECTE-SE
>  Bem-vindo ao Conecte-se!
>  Aqui você encontra vida! Grupos pequenos,
> células, que se reúnem semanalmente. Nós oramos e desejamos que você
> desenvolva bons relacionamentos, um propósito, envolvimento e encontre
> alegria. Vamos servir ao Senhor juntos!
> 
> 
>  SLIDE 2
>  Bem-vindo ao slide 2
>  Aqui você encontra vida! Grupos pequenos,
> células, que se reúnem semanalmente. Nós oramos e desejamos que você
> desenvolva bons relacionamentos, um propósito, envolvimento e encontre
> alegria. Vamos servir ao Senhor juntos!
> 
> 
>  SLIDE 3
>  Bem-vindo ao slide 3
>  Aqui você encontra vida! Grupos pequenos,
> células, que se reúnem semanalmente. Nós oramos e desejamos que você
> desenvolva bons relacionamentos, um propósito, envolvimento e encontre
> alegria. Vamos servir ao Senhor juntos!
> 
>
> ___
> 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] RE: Flash speech-to-text

2009-08-26 Thread Taka Kojima
You wouldn't actually do the speech recognition in Flash, but rather have
Flash record to a file, have the server process it (using an already
developed program of course, as as Steven explains speech to text is not
just a simple matter).

So essentially the flow would be:

Flash Player would record the sound, tell server to save file to x location,
open a socket connection to server, tell the server to process the sound
file. Then, through the socket connection you would send data back to Flash
as you process the file.

This is a real simple overview, but essentially if you in fact can record
sound through the microphone with Flash Player and you do have an already
built speech to text program installed and working (with an API that you
could plug into), then it is feasible and it's not as complicated as writing
your own speech to text recognition software in ActionScript.

I have implemented a similar solution for creating video files with Flash
(i.e. you drag 5-10 second clips onto a timeline, send the data back to the
server, the server reads the sequence, puts the clips together into a file
and exports as a new video file), so this is a workable and good solution,
as well as your best bet.

- Taka

On Wed, Aug 26, 2009 at 10:41 PM, Steven Sacks wrote:

> This is how you record sound:
> http://www.getmicrophone.com/?p=69
>
> If you're asking how to convert sound waves into speech, dude, what?  Do
> you realize how challenging speech recognition is?  Wait, why am I asking
> you this?  If you did, you wouldn't be asking people on a Flash list how to
> do it, as if it's some piece of code somebody can copy and paste or a few
> links that will tell you the secret formula.
>
> Most speech to text programs are based on the Hidden Markov models. In
> speech recognition, the hidden Markov model would output a sequence of
> n-dimensional real-valued vectors (with n being a small integer, such as
> 10), outputting one of these every 10 milliseconds. The vectors would
> consist of cepstral coefficients, which are obtained by taking a Fourier
> transform of a short time window of speech and decorrelating the spectrum
> using a cosine transform, then taking the first (most significant)
> coefficients. The hidden Markov model will tend to have in each state a
> statistical distribution that is a mixture of diagonal covariance Gaussians
> which will give a likelihood for each observed vector. Each word, or (for
> more general speech recognition systems), each phoneme, will have a
> different output distribution; a hidden Markov model for a sequence of words
> or phonemes is made by concatenating the individual trained hidden Markov
> models for the separate words and phonemes.
>
> There you have it. That's a high level overview of speech to text. Do you
> understand anything in that paragraph?  Probably not.
>
> Unless you're willing to study and put in the time to figure out how to do
> this, you're not going to figure it out.  Nobody is going to point you in
> the right direction because this is a very niche knowledge area and none of
> these people are on Flashcoders.  They're at universities working on their
> doctorates or working for the military or government, or some private
> company and they're not sharing this information.  This is the stuff patents
> are made of.
>
> So either give up now (because what you want is some easy solution and
> there isn't one) or start doing real research, learn some serious Calculus,
> become an expert on on sound, speech, waveforms, and then figure out how to
> port all of this into Flash, which, in all likelihood, lacks the performance
> to actually achieve this.
>
> You'll probably have to do it on the server, passing the sound to the
> server as an mp3 file, and then pass the text back. That's the only thing I
> can think of that would possibly be able to do this.
>
> Prove me wrong.  If you pull this off, you could probably build an entire
> company around your technology.
>
> ___
> 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] empty XML Attributes..

2009-08-26 Thread Taka Kojima
The Top Level XML class actually has a function, called hasOwnProperty that
exists for this purpose.

However, to answer your question exactly, it returns a value of undefined.
This is not null or "" it is it's own return type, as this relates to XML
(which by definition is an object) and objects are dynamic. Null would only
be returned if you've already declared a variable but it has no value,
undefined is returned for something that you have not declared.

So in addition to Steven's method, you could also do:

if (node.hasOwnProperty("@instance"))

or

if (no...@instance != undefined)

- Taka

On Wed, Aug 26, 2009 at 6:06 PM, Steven Sacks wrote:

> You will get runtime errors when attempting to access an attribute that
> isn't there.  The proper way to check for existence and length of an
> attribute is to use the .attributes() syntax as such:
>
> if (node.hasOwnProperty("instance").length() > 0)
>
> ___
> 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] How to add a DisplayObject into a container witho ut using addChild() method.

2009-08-19 Thread Taka Kojima
Again, I have no real issue with one way or the other, people have their
preferences, you can't force all programmers to write code in the same way.

Regarding your link:
http://opensource.adobe.com/wiki/display/flexsdk/Coding+Conventions#CodingConventions-Expressions

"Some of these standards are completely arbitrary, since there is not always
a “best way” to code. Nevertheless, in the interest of consistency, all
commits to the Flex SDK project will be expected to follow these
conventions."

I'm all for consistency, so if you're developing flex framework components,
by all means stick to the conventions. Otherwise, the conventions within a
given environment are all going to be different. We do have a conventions
doc at my work that we all agreed on as a whole, and it works quite well,
all of the code in our framework and components is very consistent.

I, for one take pride in having extremely readable and manageable code, this
is mainly due to me having to take on other people's work countless times
when it was a complete mess. I'm not trying to say that I code better than
anybody else, or that the approach I take, or syntax I use is even correct,
but it works and I've only gotten compliments on having clean, easy to read
code, and never gotten any negative remarks or comments about how I code.

And this is also not to say that I don't use the less code method at all. I
definitely use ternary operators and I always try to consolidate code, but
if it affects the readability to a certain point, I will rewrite it to make
it clearer.

- Taka


On Tue, Aug 18, 2009 at 8:48 PM, Taka Kojima  wrote:

I didn't understand your analogy at all.
>
> --
> Steven Sacks wrote:
>
> Taka,
>
> When you're done building your Straw Man, you let me know and I'll happily
> continue the discussion with you.
>
> Cheers,
> Steven
>
>
> Taka Kojima wrote:
> > Writing readable code > writing less code.
> >
> > That is what it comes down to. Most coders can understand both of the
> > following:
> >
> > if(myObj){;}
> >
> > and
> >
> > if(myObj != null){;}
> >
> > I would opt for the latter method always, as otherwise you are relying on
>
> > renderer specific logic to handle the conversion, as opposed to explicit
> > conversion.
> >
> > I have actually spent an hr trying to debug an IE specific JS error, only
> to
> > find that even though implicit type conversion was working in other
> > browsers, it was throwing an error in a specific version of IE.
> >
> > By your argument of less code > more code, this:
> >
> > public function outputList():*{;}
> >
> > would be better than
> >
> > public function outputList():Array{;}
> >
> > and AS2 would be better than AS3 on the whole basis that you didn't have
> to
> > typecast anything.
> >
> > Just because a certain environment can convert types for you, doesn't
> mean
> > that you shouldn't typecast or not hint as to their object type in your
> > code.
> >
> > Personally, I can type faster than I can think in code. I type really
> fast,
> > and I think code really fast, and typing out the extra 10 characters
> doesn't
> > hinder my productivity, it probably enhances it.
> >
> > If you want to take the implicit convesion route, by all means I am not
> > going to stop you or object. However, I do and will always believe that
> it
> > is better for other people reading/working on your code that you do spell
> it
> > all out, use line breaks when it makes sense, and typecast all your
> > variables.
> >
> > I think Dave's point was that you seemed rather authoritative, and this
> is
> > really a subjective matter.
> >
> > - Taka
> ___
> 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] How to add a DisplayObject into a container without using addChild() method.

2009-08-18 Thread Taka Kojima
Writing readable code > writing less code.

That is what it comes down to. Most coders can understand both of the
following:

if(myObj){;}

and

if(myObj != null){;}

I would opt for the latter method always, as otherwise you are relying on
renderer specific logic to handle the conversion, as opposed to explicit
conversion.

I have actually spent an hr trying to debug an IE specific JS error, only to
find that even though implicit type conversion was working in other
browsers, it was throwing an error in a specific version of IE.

By your argument of less code > more code, this:

public function outputList():*{;}

would be better than

public function outputList():Array{;}

and AS2 would be better than AS3 on the whole basis that you didn't have to
typecast anything.

Just because a certain environment can convert types for you, doesn't mean
that you shouldn't typecast or not hint as to their object type in your
code.

Personally, I can type faster than I can think in code. I type really fast,
and I think code really fast, and typing out the extra 10 characters doesn't
hinder my productivity, it probably enhances it.

If you want to take the implicit convesion route, by all means I am not
going to stop you or object. However, I do and will always believe that it
is better for other people reading/working on your code that you do spell it
all out, use line breaks when it makes sense, and typecast all your
variables.

I think Dave's point was that you seemed rather authoritative, and this is
really a subjective matter.

- Taka

On Tue, Aug 18, 2009 at 6:02 PM, Peter B  wrote:

> 2009/8/19 Leandro Ferreira :
> > A good CODER must go beyond a good CODE be fast when needed. That's MHO,
> and
> > It gets clear when we compare the number of lines we use to express
> > ourselves.
> >
>
> Indeed. And you unintentionally help to illustrate the point. Paul's
> post, though long, is clear in what it communicates. Your post is
> brief, but I am finding it difficult to extract any meaning from it.
> ___
> 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] mac vs pc

2009-08-10 Thread Taka Kojima
100% PC. I have a PC at home and a Mac at work, but I'm running Vista on an
8 core Mac Pro (no paralleling, I boot up in Windows through base camp).

I can and do use Macs, I'm not a PC fanatic per se, but I just find PC's to
be a faster workflow for me in terms of development. Also, Macs have shoddy
FTP clients, even Filezilla is a bit sketchy on OS X.

I'm the only person on my team that uses a PC development environment.


On Mon, Aug 10, 2009 at 11:28 AM, Christian Pugliese wrote:

> 50% Mac > all my freelancer jobs
> 50% PC > all may day job
>
> if I could I'd use 100% of Mac, but the agency I work for only uses PCs...
> perhaps I love the Mac I miss a looot a FlashDevelop version for OSX.
>
> Christian Pugliese
> www.chrisid.com
>
>
>
>
> On Mon, Aug 10, 2009 at 15:20, Karl DeSaulniers  >wrote:
>
> > 99% Mac and 1% PC
> > I only use PCs to test websites on IE.
> > Mac for everything else I need.
> >
> > Karl
> >
> >
> > On Aug 10, 2009, at 9:10 AM, John R. Sweeney Jr wrote:
> >
> >  90% Mac, 10% PC.
> >>
> >> PC for mostly Director development
> >> MAC for Flash, web, audio and video work.
> >>
> >> John
> >>
> >>
> >> on 8/10/09 5:55 AM, Allandt Bik-Elliott (Receptacle) at
> >> alla...@receptacledesign.com wrote:
> >>
> >>  So the question I'm really getting to is, how many people use osX
> >>> (using windows in boot camp doesn't count) and how many are using
> >>> windows for their main work machine and what kind of software setup
> >>> are you using?
> >>>
> >>> thanks for your time guys
> >>> Allandt
> >>>
> >>
> >>
> >> John R. Sweeney Jr.
> >> Interactive Multimedia Developer
> >>
> >>
> >> OnDemand Interactive Inc
> >> 945 Washington Blvd.
> >> Hoffman Estates, IL 60169
> >> Office/Fax: 847.310.5959
> >> Cellular: 847.651.4469
> >> www.ondemandinteractive.com
> >>
> >>
> >> ___
> >> Flashcoders mailing list
> >> Flashcoders@chattyfig.figleaf.com
> >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >>
> >
> > Karl DeSaulniers
> > Design Drumm
> > http://designdrumm.com
> >
> > ___
> > Flashcoders mailing list
> > Flashcoders@chattyfig.figleaf.com
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] To Void or not to void?? That is my question..

2009-07-13 Thread Taka Kojima
Let's say I wanted to do something like this...

trace("Taka " + getLastName("Taka"));

function getLastName(firstName:String):String{
if(firstName == "Taka"){return "Kojima";}
else{return "";}
}

That function returns a String. Having a gotoAndPlay() inside a function is
not a return value.

Hope that helps.

 -Taka

On Mon, Jul 13, 2009 at 9:29 PM, Karl DeSaulniers wrote:

> Thanks for the quick response Taka,
>
> So what contitutes a return?
>
> I have used the :Void on functions that had a gotoAndPlay() inside it and
> it didnt work.
> But if I removed the :Void, it did!?!
>
>
> Karl
>
>
>
> On Jul 13, 2009, at 11:18 PM, Taka Kojima wrote:
>
>  :Void is AS2, and :void is AS3
>>
>> The definition of void is "nothingness: the state of nonexistence"...
>>
>> The syntax of functionName():void{} simply states that the function
>> returns
>> nothing... i.e. there is no return at the end of the function.
>>
>> Although specifying a :void return type is not necessary in AS3, it is
>> considered best practice to include it. I believe it will generate
>> warnings
>> if you don't.
>>
>> In AS2, it really doesn't matter if you do :Void after functions.
>>
>> The reason this syntax exists is to make it easy for compilers to easily
>> identify problems in regards to object types, i.e. if you're trying to use
>> the return value of a function as a MovieClip when it should really be an
>> Array, or void. It also makes it easier for you to see what type of value
>> the function is returning just by looking at the top of the function
>> definition.
>>
>> - Taka
>>
>> On Mon, Jul 13, 2009 at 9:07 PM, Karl DeSaulniers > >wrote:
>>
>>  Using AS2.
>>> When is it best to use the :Void ? and what is the difference between
>>> that
>>> and :void ?
>>> I have a somewhat understanding of what each are,
>>> I am asking more to "you" (The List) as a programers, what is the best
>>> case
>>> scenarios to use these things?
>>> What are the advantages and why use them if say, your function works
>>> without them?
>>> I know that the Void is a Boolean, but I also know you cant use it when
>>> the
>>> statement returns something.
>>> Does this "return" include any of the basics like gotoAndPlay? or does it
>>> literally mean a return(); ???
>>>
>>> Thanks for any clarification anyone can give me.
>>>
>>> Best,
>>>
>>>
>>> Karl DeSaulniers
>>> Design Drumm
>>> http://designdrumm.com
>>>
>>> ___
>>> 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
>>
>
> Karl DeSaulniers
> Design Drumm
> http://designdrumm.com
>
> ___
> 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] To Void or not to void?? That is my question..

2009-07-13 Thread Taka Kojima
:Void is AS2, and :void is AS3

The definition of void is "nothingness: the state of nonexistence"...

The syntax of functionName():void{} simply states that the function returns
nothing... i.e. there is no return at the end of the function.

Although specifying a :void return type is not necessary in AS3, it is
considered best practice to include it. I believe it will generate warnings
if you don't.

In AS2, it really doesn't matter if you do :Void after functions.

The reason this syntax exists is to make it easy for compilers to easily
identify problems in regards to object types, i.e. if you're trying to use
the return value of a function as a MovieClip when it should really be an
Array, or void. It also makes it easier for you to see what type of value
the function is returning just by looking at the top of the function
definition.

- Taka

On Mon, Jul 13, 2009 at 9:07 PM, Karl DeSaulniers wrote:

> Using AS2.
> When is it best to use the :Void ? and what is the difference between that
> and :void ?
> I have a somewhat understanding of what each are,
> I am asking more to "you" (The List) as a programers, what is the best case
> scenarios to use these things?
> What are the advantages and why use them if say, your function works
> without them?
> I know that the Void is a Boolean, but I also know you cant use it when the
> statement returns something.
> Does this "return" include any of the basics like gotoAndPlay? or does it
> literally mean a return(); ???
>
> Thanks for any clarification anyone can give me.
>
> Best,
>
>
> Karl DeSaulniers
> Design Drumm
> http://designdrumm.com
>
> ___
> 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] renaming files with air

2009-06-29 Thread Taka Kojima
Those of us used to low-level programming wouldn't think twice about this,
moving === renaming.

However, to somebody who has mainly done ActionScript or higher level
programming, etc. I can see how this might seem weird.

This is the way it's done, almost universally in programming (as far as I
know), it's definitely the same if you want to rename a file in Unix -- i.e.
mv origFile newFile

- Taka

On Mon, Jun 29, 2009 at 5:11 PM, Nate Beck  wrote:

> Why would they need to put in an rename function if they already have a
> move
> method..?  They do the same thing.
>
> On Mon, Jun 29, 2009 at 11:49 AM, Anthony Pace  >wrote:
>
> > Am I mistaken, or do I have to use moveTo() to rename a file?  it seems
> > kind of stupid to me, that they wouldn't just put a rename function in;
> yet,
> > if that is what I have to use then so be it.
> > ___
> > Flashcoders mailing list
> > Flashcoders@chattyfig.figleaf.com
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
>
>
>
> --
>
> Cheers,
> Nate
> 
> http://blog.natebeck.net
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Something to appreciate...

2009-06-15 Thread Taka Kojima
http://pastie.org/513192

This is the file I have to traverse through this afternoon, gotta love
contractors.

p.s. Read the comment at the top to get the full scope.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Problem with links in htmlText

2009-06-05 Thread Taka Kojima
I looked at your stream, and it looks like you are using the wrong response
data.

"unescapedUrl":"http://www.nbclosangeles.com/news/local/Employee-Allegedly-Steals-250K-in-Fuel-from-City.html","url":"http%3A%2F%2Fwww.nbclosangeles.com%2Fnews%2Flocal%2FEmployee-Allegedly-Steals-250K-in-Fuel-from-City.html";

The response returns two properties, you should be using "unescapedUrl", and
it looks like you are using "url" to set the href. So, you can do one of two
things. Obviously, since the unescapedUrl is already being passed back, you
can just use that or when you set the href you can run an unescape on it in
flash, i.e. "unescape(url)"

- Taka

On Fri, Jun 5, 2009 at 5:50 PM, Karl DeSaulniers wrote:

> Can we see your code where you assigning the URL?
>
> Sent from losPhone
>
>
> On Jun 5, 2009, at 6:33 PM, Carl Welch  wrote:
>
>  Hi Guys & Gals,
>>
>> I am having a hard time getting htmlText to link their hrefs properly.
>>
>> example here:
>> http://www.carlwelch.com/searchTest.html
>>
>> I have the href target set to "_blank", but when the link is selected, my
>> server address (http://www.carlwelch.com/) gets added to the beginning of
>> the url, like this:
>>
>>
>> http://www.carlwelch.com/http%3A%2F%2Fwww.metnews.com%2Farticles%2F2009%2Fhanl060309.htm
>>
>> ... how can I prevent this from happening???
>>
>>
>> Thanks!!
>> --
>> Carl Welch
>> http://www.carlwelch.com
>> http://blog.jointjam.com
>> carlwelchdes...@gmail.com
>> 805.403.4819
>>
>>
>>
>>
>>
>> ___
>> Flashcoders mailing list
>> Flashcoders@chattyfig.figleaf.com
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] JSON Experiences

2009-05-20 Thread Taka Kojima
http://www.json.org/json.as

On Wed, May 20, 2009 at 5:18 PM, Karl DeSaulniers wrote:

> Sorry to be so dinosaur, but is there something like this for AS2?
> Encoding and decoding sent data for and AS2 project?
>
> Karl DeSaulniers
> Design Drumm
> http://designdrumm.com
>
>
> On May 20, 2009, at 6:17 PM, Steven Sacks wrote:
>
>  Agreed!
>>
>>
>> On May 20, 2009, at 3:45 PM, Taka Kojima wrote:
>>
>>  IMO, there are times to use JSON and times to use XML.
>>>
>>> JSON is very easy to implement and not very hard to grasp... all you're
>>> basically doing is running an encode when you send data out and a decode
>>> when you bring data in. So you only need two functions.
>>>
>>> E4X is definitely powerful, however if you're just sending small bits of
>>> data back and forth and don't need to do any complex filtering/sorting of
>>> data in Flash, JSON will definitely do the trick, and I would recommend
>>> it
>>> over XML.
>>>
>>> - Taka
>>>
>>> On Wed, May 20, 2009 at 3:11 PM, Manish Jethani <
>>> manish.jeth...@gmail.com>wrote:
>>>
>>>  On Thu, May 21, 2009 at 12:12 AM, Gregory Boland
>>>>  wrote:
>>>>
>>>>  Does anyone know of a good place to see some AS3 code that uses JSON so
>>>>> i
>>>>> can see how it works?
>>>>>
>>>>
>>>> Using JSON is fairly simple using the corelib library:
>>>>
>>>> http://code.google.com/p/as3corelib/
>>>>
>>>> You have to use the encode and decode functions of the JSON class.
>>>>
>>>> You could also go a step further and use my JSONObject class, which I
>>>> find a bit more intuitive:
>>>>
>>>>
>>>> http://manishjethani.com/blog/2008/08/25/jsonobject-for-reading-
>>>> and-writing-json-in-actionscript/
>>>>
>>>> Manish
>>>> ___
>>>> Flashcoders mailing list
>>>> Flashcoders@chattyfig.figleaf.com
>>>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>>>
>>>>  ___
>>> Flashcoders mailing list
>>> Flashcoders@chattyfig.figleaf.com
>>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>>
>>
>> ___
>> Flashcoders mailing list
>> Flashcoders@chattyfig.figleaf.com
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>
>
>
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] JSON Experiences

2009-05-20 Thread Taka Kojima
IMO, there are times to use JSON and times to use XML.

JSON is very easy to implement and not very hard to grasp... all you're
basically doing is running an encode when you send data out and a decode
when you bring data in. So you only need two functions.

E4X is definitely powerful, however if you're just sending small bits of
data back and forth and don't need to do any complex filtering/sorting of
data in Flash, JSON will definitely do the trick, and I would recommend it
over XML.

- Taka

On Wed, May 20, 2009 at 3:11 PM, Manish Jethani wrote:

> On Thu, May 21, 2009 at 12:12 AM, Gregory Boland
>  wrote:
>
> > Does anyone know of a good place to see some AS3 code that uses JSON so i
> > can see how it works?
>
> Using JSON is fairly simple using the corelib library:
>
> http://code.google.com/p/as3corelib/
>
> You have to use the encode and decode functions of the JSON class.
>
> You could also go a step further and use my JSONObject class, which I
> find a bit more intuitive:
>
>
> http://manishjethani.com/blog/2008/08/25/jsonobject-for-reading-and-writing-json-in-actionscript/
>
> Manish
> ___
> 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] is imported db text safe from decompilers?

2009-05-13 Thread Taka Kojima
This won't solve the issue, ssl certs do encrypt data, but they are
not meant to encrypt the data so that it is unreadable to the end
user... they are meant so that if I am conducting a transaction
online, it encrypts all the data so that Bob over in Arkansas can't
jack the posted fom data.

So, if I am looking at the net stream, through a common tool like
FireBug, I will definitely be able to see all the data going to and
from flash player.

- Taka

On Wed, May 13, 2009 at 12:32 PM, webmastermack  wrote:
> I should have mentioned that I am also using a SSL certificate to encrypt 
> traffic to and from the site.  Doesn't this deter packet sniffers?
>
> -Webmastermack
>
> --
> Yes, but it can easily be viewed as it's coming across the wire using
> packet sniffers or other similar tools.
>
> Dave Watts, CTO, Fig Leaf Software
> http://www.figleaf.com/
>
>
>
>
>
> ___
> 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] best way to save as pdf from flash?

2009-05-13 Thread Taka Kojima
I believe he is trying to export as a PDF from FlashPlayer, not from
Flash itself

On Wed, May 13, 2009 at 11:22 AM, Paul Andrews  wrote:
> If you're using Flash as some high end illustration program, do yourself a
> favour and use Xara Xtreme (http://www.xara.com/uk/products/xtreme/) - it
> has native PDF export and is far more
> capable than flash for illustration..
>
> Paul
> - Original Message - From: "Anthony Pace" 
> To: "Flash Coders List" 
> Sent: Wednesday, May 13, 2009 6:07 PM
> Subject: Re: [Flashcoders] best way to save as pdf from flash?
>
>
>> I was referring to the ide; yet, even the flashplayer has the the same
>> printing bugs
>>
>> -screenshots are out of the question; as I usually am printing very large
>> files
>> -I have already tried printing directly to a PDF print server, from the
>> flash IDE; however, the effects I place on MCs don't seem to stay.
>> -I would use illustrator; yet, it just doesn't have a lot of flash's
>> capabilities, and vise versa when doing extrusions for illustration or
>> using livepaint.  I know I can export the paths to illustrator; yet, the
>> effects don't transfer well, if at all, and I am not a fan of the poor
>> quality of some of the illustrator effects.
>> -I know that I could convert the movie clip to a bitmap in as3 and then
>> either convert it to a pdf or png/jpg using a decent library, or printing
>> it as a converted bitmap to a pdf server(as long as the pixel count is
>> less than 16,775,168, a problem when converting to posters that need a
>> bare minimum quality of 300 dpi at 27" x 41" or 99,630,000 pixels), and it
>> will be the direction I am going in; however, I really shouldn't have to
>> program this myself, as it should already be a capability of the ide,
>> along with better integration with photoshop and illustrator and much much
>> better file conversion.
>>
>> Printing from the flash IDE or a much better form of integration with
>> illustrator and photoshop would be best.
>>
>>
>> Glen Pike wrote:
>>>
>>> Hi,
>>>
>>>   I am assuming you are talking about the IDE?
>>>
>>>   Are you doing screenshots for the client?
>>>     It might not be helpful, but I just do  Test Movie then Alt+Print
>>> Screen or Ctrl+Print Screen and paste into my graphics program...
>>>
>>>   Alternatively look at CutePDF or one of the "free" PDF printers that
>>> might help.
>>>
>>>   Printing from SWF's with the FP Printer - you can draw into a bitmap
>>> first, then print the MC with that in - this means all your filters &
>>> fonts should have been rasterised.
>>>
>>>   HTH - might have misunderstood your request...
>>>
>>>   Glen
>>>
>>> Anthony Pace wrote:

 I would print directly to pdf; yet, I lose the effects I have placed on
 MCs; as well, saving it to illustrator directly is a problem, because
 flash will screw up the file header when a custom font that I use is
 required.

 Thus, because flash doesn't have a decent printer driver, and its file
 conversion methods suck, my current process is:

 I create an swf of the dimensions I want in inches (e.g. 8.5 x 11)
 I convert to png and choose a DPI of something like 300 to indicate high
 resolution, and I select 24 bit, with no alpha channel, in order to
 avoid the ARGB conversion that is screwed for flash.
 I open that png and I open something like photoshop/illustrator that
 allows you to convert to a pdf.

 Is there a better way?
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


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

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


Re: [Flashcoders] Interesting problem - doesn't work without call to trace.

2009-04-17 Thread Taka Kojima
Hey Tim,

I have run into this before as well, with both ActionScript and using
alert() in JavaScript.

What I concluded was that the trace/alert basically adds a small pause
or causes something to happen (i.e. skip a frame or something of the
sort) so that the code below it works.

I may be totally wrong and this may sound crazy and stupid, but
whenever I did something like take the trace out and put the rest of
the code into a COMPLETE event for a timer, or had the code run on the
next frame with an onEnterFrame, it started working.

I know you say you don't think its a timing issue, but instead of the
loop try doing a Timer and see if that solves it.




On Fri, Apr 17, 2009 at 9:09 AM, Tim Hawkins  wrote:
> Well, it becomes a null - so if I do select1.toString() in the trace I just
> get a runtime error.. And I don't want to turn the results of my query into
> a string, because I need it as an XML ref.
>
> 2009/4/17 Glen Pike 
>
>> Have you tried the toString or toXMLString for this - check the XML class
>> for the proper function name...
>> Glen
>>
>>
>> Tim Hawkins wrote:
>>
>>> Hi Matt,
>>> No, afraid not.. I actually use the select1 variable elsewhere, so it's
>>> not
>>> just that trace which is the problem.
>>>
>>> Thanks for the suggestion though!
>>>
>>>
>>>
>>> 2009/4/17 Matt S. 
>>>
>>>
>>>
 Does it make a difference if you write the trace as :

 trace("formData="+formData);
 trace("select1:"+ select1);


 On 4/17/09, Tim Hawkins  wrote:


> Hi,
> I've come across this a few times in my own code, but haven't seen it
> mentioned online - though it's a difficult thing to google for.
>
> In the following function, if the trace at the top is present, formData
> traces a load of XML and select1 also traces a load of XML.
>
> If I comment out the top trace, formData still traces the same pile of
>
>
 XML


> but select1 traces null!
>
> public function testMakeModelFilterWorks():void {
>
>  trace("");
>  default xml namespace  = NAMESPACE;
>
> var select1:XML = formData..select1[2];
> trace("formData=", formData);
>  trace("select1:", select1);
>
> // etc
> default xml namespace = null;
> }
>
> Any ideas? I'm getting fed up of leaving 'trace("");//don't delete me'
> at
> the top of functions.
> (I don't think it's a timing thing, if I put a 10-item
> increment-a-variable loop in there instead of a trace the E4X still
>
>
 fails.)


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

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


Re: [Flashcoders] Flashplayer "positioning"

2009-04-03 Thread Taka Kojima
Glad you figured it out Glen and thanks for the solution/workaround.

On Fri, Apr 3, 2009 at 11:07 AM, Glen Pike  wrote:
> Hi,
>
>   This was an issue with the Flashplayer running without a Window manager -
> for some reason FP10 defaulted to a 200x200 pixel sized window and ignored
> the size of the Flash content when run in "fullscreen".
>
>   The only way around this is to run a desktop / window manager and launch
> Flashplayer inside that - problematic because if Flash dies / exits, the
> user gets access to the desktop rather than a blank screen  - not good for
> kiosk apps.
>
>   Funny thing is, Flashplayer 9 is fine, so have submitted a bug because
> that's an unexpected change of behaviour that we have no way of working
> around..
>
>   Thanks for your help, maybe this will be useful for anyone with similar
> problems
>
>   Glen
>
>
> Glen Pike wrote:
>>
>> Hi,
>>
>>   I tried the Stage.align but this has no effect.
>>
>>   The stage size is the same as the monitor size.
>>
>>   Looking into this further, it seems to be an issue with the Window
>> Manager - if we run X11 with no Window Manager and start Flashplayer from
>> the command line it can't seem to position itself properly.  If we run Flash
>> with a Window Manager / Desktop, e.g. xfce, it aligns fine.  I am guessing
>> something changed in FP10 relating to X11 but what...
>>
>>   Glen
>>
>> Taka Kojima wrote:
>>>
>>> not sure, maybe FP10 defaults to a different stage alignment. Maybe
>>> try explicity stating the stage alignment and see if that fixes it.
>>>
>>> - Taka
>>>
>>> On Thu, Apr 2, 2009 at 11:16 AM, Glen Pike 
>>> wrote:
>>>
>>>>
>>>> Hi,
>>>>
>>>>  There is stuff offstage, but I am not sure if it is in a guide layer or
>>>> not - will check later.
>>>>
>>>>  Why this would happen in FP10 and not 9 though??
>>>>
>>>>  Glen
>>>>
>>>> Joel Stransky wrote:
>>>>
>>>>>
>>>>> Is there any off-stage content that might be causing this?
>>>>>
>>>>> On Thu, Apr 2, 2009 at 12:42 PM, Glen Pike
>>>>> wrote:
>>>>>
>>>>>
>>>>>
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>>  I have just setup FP10 in standalone on my Gentoo Linux box and am
>>>>>> running a SWF from the command line in standalone mode.
>>>>>>
>>>>>>  The x, y position of my SWF is all wrong - the SWF is positioned
>>>>>> mostly
>>>>>> off the screen.  Reverting to FP9 standalone it works fine.
>>>>>>
>>>>>>  The SWF is compiled for AS2.
>>>>>>
>>>>>>  Does anyone have any ideas about this??
>>>>>>   Ta
>>>>>>
>>>>>>  Glen
>>>>>> ___
>>>>>> Flashcoders mailing list
>>>>>> Flashcoders@chattyfig.figleaf.com
>>>>>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>> --
>>>>
>>>> Glen Pike
>>>> 01326 218440
>>>> www.glenpike.co.uk <http://www.glenpike.co.uk>
>>>>
>>>> ___
>>>> Flashcoders mailing list
>>>> Flashcoders@chattyfig.figleaf.com
>>>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>>>
>>>>
>>>
>>> ___
>>> Flashcoders mailing list
>>> Flashcoders@chattyfig.figleaf.com
>>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>>
>>>
>>>
>>
>> ___
>> Flashcoders mailing list
>> Flashcoders@chattyfig.figleaf.com
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>>
>
> --
>
> Glen Pike
> 01326 218440
> www.glenpike.co.uk <http://www.glenpike.co.uk>
>
> ___
> 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] id3 runtime error

2009-04-03 Thread Taka Kojima
Do you have firebug?

Is it possible that it's using the wrong path or even trying to
request "" when it makes the call? If you have firebug, you can look
at all of the http requests through the net panel.

If you're using a variable to make the load call, try hardcoding a
value and see if that solves the issue...

Although, I'm not sure if Flash is throwing the security error if it
will even show up.

Can you paste the code that does the loading and event handling?

- Taka

On Fri, Apr 3, 2009 at 10:49 AM, Dave Segal  wrote:
> This is the error I am seeing. Strangely the part after the word "access" is 
> left blank. Which leads me to believe it is some kind of timing bug on my 
> side however, the trigger for this function is the ID3 event. I also tried 
> waiting for the COMPLETE event but the same issue occurs. As I mentioned the 
> mp3 file is on the same server so I'm not sure why it would be looking for a 
> policy file at all. The files are in different directories however if that 
> gives some clue.
>
> SecurityError: Error #2122: Security sandbox violation: Sound.id3: 
> http://content.dev.com/char/engines/engine.swf cannot access . A policy file 
> is required, but the checkPolicyFile flag was not set when this media was 
> loaded.
>
> Thanks for your help.
>
>
> - Original Message -
> From: "Taka Kojima" 
> To: "Flash Coders List" 
> Sent: Thursday, April 2, 2009 8:08:05 PM GMT -05:00 US/Canada Eastern
> Subject: Re: [Flashcoders] id3 runtime error
>
> Hey Dave,
>
> Can you paste the exact error message?
>
> On Thu, Apr 2, 2009 at 4:51 PM, Dave Segal  wrote:
>> I have a bug that is driving me nuts. I am loading an mp3 file from the
>> same server as my swf. About 1 in 30 tries when trying to reading the id3
>> tags after the ID3 event I get a runtime error telling me I need to load
>> the crossdomain policy file in order to access the tags. I tried setting
>> the checkpolicyfile flag to true and placing a valid crossdomain.xml on
>> the server but the error occurs with the same frequency.
>>
>> ___
>> Flashcoders mailing list
>> Flashcoders@chattyfig.figleaf.com
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>

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


Re: [Flashcoders] id3 runtime error

2009-04-02 Thread Taka Kojima
Hey Dave,

Can you paste the exact error message?

On Thu, Apr 2, 2009 at 4:51 PM, Dave Segal  wrote:
> I have a bug that is driving me nuts. I am loading an mp3 file from the
> same server as my swf. About 1 in 30 tries when trying to reading the id3
> tags after the ID3 event I get a runtime error telling me I need to load
> the crossdomain policy file in order to access the tags. I tried setting
> the checkpolicyfile flag to true and placing a valid crossdomain.xml on
> the server but the error occurs with the same frequency.
>
> ___
> 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] Flashplayer "positioning"

2009-04-02 Thread Taka Kojima
not sure, maybe FP10 defaults to a different stage alignment. Maybe
try explicity stating the stage alignment and see if that fixes it.

- Taka

On Thu, Apr 2, 2009 at 11:16 AM, Glen Pike  wrote:
> Hi,
>
>   There is stuff offstage, but I am not sure if it is in a guide layer or
> not - will check later.
>
>   Why this would happen in FP10 and not 9 though??
>
>   Glen
>
> Joel Stransky wrote:
>>
>> Is there any off-stage content that might be causing this?
>>
>> On Thu, Apr 2, 2009 at 12:42 PM, Glen Pike
>> wrote:
>>
>>
>>>
>>> Hi,
>>>
>>>  I have just setup FP10 in standalone on my Gentoo Linux box and am
>>> running a SWF from the command line in standalone mode.
>>>
>>>  The x, y position of my SWF is all wrong - the SWF is positioned mostly
>>> off the screen.  Reverting to FP9 standalone it works fine.
>>>
>>>  The SWF is compiled for AS2.
>>>
>>>  Does anyone have any ideas about this??
>>>    Ta
>>>
>>>  Glen
>>> ___
>>> Flashcoders mailing list
>>> Flashcoders@chattyfig.figleaf.com
>>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>>
>>>
>>
>>
>>
>>
>
> --
>
> Glen Pike
> 01326 218440
> www.glenpike.co.uk 
>
> ___
> 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] FPS question

2009-04-01 Thread Taka Kojima
Alright, well my two cents is that the problem isn't what you think it
is, and here's why:

I build a lot of sites and the reason it's chugging is not anything to
do with streaming... if you truly do have a preloader, and it does
load in 100% before playing, it's not a streaming issue. It seems to
be a CPU issue.

If the computers with slower connections you are testing on are older
computers (which for some reason is usually the case) then it may seem
like it's the connection speed, where in fact it is the CPU chugging.

The idea that animating on the timeline is x amount slower than doing
it through code is a myth that's not true. It is true that you can
optimize some thing through code, but unless you're doing some crazy
animation stuff then that's likely not the issue either.

The proper solution: bring down the cpu usage, which isn't an exact
science you'll just have to futz around with things and use common
sense, such as using blank keyframes when things are off the stage,
making sure you aren't animating a lot of vectors (and if you are use
bitmap caching), etc.

- Taka

On Wed, Apr 1, 2009 at 2:27 PM, Karl DeSaulniers  wrote:
> Please excuse the auto correction of my email client. It doesn't always know
> what I am trying to say. :p
>
> That's preloaders not preliaders
>
> Sent from losPhone
>
> On Apr 1, 2009, at 4:17 PM, Karl DeSaulniers  wrote:
>
>> Yes you are correct about the preliaders and the different versions of
>> sites per connection speed.
>>
>> Here is what I am experiencing and why I am lookijng for this solution. I
>> have a preloader on my site and it preloads fine. But even with the preload
>> I still get a lag when it starts playing. There is no way I am building
>> three sites every time I make a site. So I wanted to have a streaming script
>> watch the stream and adjust accordingly so that there would be no lag. I
>> have been to many flash site that load significantly faster than mine and
>> they have more in them. Alas too a lot of my animations are animations and
>> not tween animations. I am not the best coder (as you can tell) so I am
>> relying on animation to suffice. This is not the best practice I know, but
>> bills need to be paid and I have no time to go back to school. I am self
>> taught and so the industry standards on how to do this, I have not been
>> introduced to. I don't mean to sound like the biggest idiot, but in AS I
>> guess I am. Thanks for your input on this. Everything helps.
>>
>> Sent from losPhone
>>
>> On Apr 1, 2009, at 3:51 PM, Taka Kojima  wrote:
>>
>>> Back to the original issue at hand. I think that is is definitely not
>>> optimal to be relying upon somebody's connection speed/bandwidth to
>>> determine fps and/or how to display content.
>>>
>>> I believe that's why people use preloaders.
>>>
>>> On Wed, Apr 1, 2009 at 1:03 PM, Anthony Pace 
>>> wrote:
>>>>
>>>> Hello Taka,
>>>>
>>>> I agree with you; as well, with regard to the swf, it would take a ton
>>>> of in
>>>> depth knowledge and understanding about its file structure, and how it
>>>> handles tweens, that I don't have right now, in order for me to say if
>>>> its
>>>> even possible.
>>>>
>>>> Thanks.
>>>> Anthony Pace
>>>>
>>>> Taka Kojima wrote:
>>>>>
>>>>> I believe the standard way of handling this is to have three different
>>>>> versions of your movie.
>>>>>
>>>>> low, normal and high quality (how you down the file size is totally
>>>>> dependent on you, could be dropping frames, could be lower rez,
>>>>> whatever). Which one gets loaded in can be determined by connection
>>>>> speed, I think this is pretty much the norm way of doing it, and while
>>>>> Anthony's solution is good in theory, I think it would be too much of
>>>>> a pain in the ars, not to mention a butt load of server-side
>>>>> processing every time a user loads your site.
>>>>>
>>>>> - Taka
>>>>>
>>>>> On Wed, Apr 1, 2009 at 6:44 AM, Paul Andrews  wrote:
>>>>>
>>>>>>
>>>>>> "default your mechanism"?
>>>>>>
>>>>>> LOL "defeat your mechanism"?
>>>>>>
>>>>>> Paul
>>>>>> - Original Message - From: "Paul Andrews" 
>>>>>

Re: [Flashcoders] FPS question

2009-04-01 Thread Taka Kojima
Back to the original issue at hand. I think that is is definitely not
optimal to be relying upon somebody's connection speed/bandwidth to
determine fps and/or how to display content.

I believe that's why people use preloaders.

On Wed, Apr 1, 2009 at 1:03 PM, Anthony Pace  wrote:
> Hello Taka,
>
> I agree with you; as well, with regard to the swf, it would take a ton of in
> depth knowledge and understanding about its file structure, and how it
> handles tweens, that I don't have right now, in order for me to say if its
> even possible.
>
> Thanks.
> Anthony Pace
>
> Taka Kojima wrote:
>>
>> I believe the standard way of handling this is to have three different
>> versions of your movie.
>>
>> low, normal and high quality (how you down the file size is totally
>> dependent on you, could be dropping frames, could be lower rez,
>> whatever). Which one gets loaded in can be determined by connection
>> speed, I think this is pretty much the norm way of doing it, and while
>> Anthony's solution is good in theory, I think it would be too much of
>> a pain in the ars, not to mention a butt load of server-side
>> processing every time a user loads your site.
>>
>> - Taka
>>
>> On Wed, Apr 1, 2009 at 6:44 AM, Paul Andrews  wrote:
>>
>>>
>>> "default your mechanism"?
>>>
>>> LOL "defeat your mechanism"?
>>>
>>> Paul
>>> - Original Message - From: "Paul Andrews" 
>>> To: "Flash Coders List" 
>>> Sent: Wednesday, April 01, 2009 1:36 PM
>>> Subject: Re: [Flashcoders] FPS question
>>>
>>>
>>>
>>>>
>>>> Karl,
>>>>
>>>> Despite what has been suggested, this will still only have a chance of
>>>> working work for some flash Movies written in a certain way. Many of my
>>>> flash movies are only one frame, sometimes just a handful of frames, so
>>>> your
>>>> attempt to smoothly run a high-bandwidth movie on a slow connection
>>>> would
>>>> fail for movies like mine - either because they load a lot of assets at
>>>> a
>>>> particular frame, or because they load assets via code during the movie.
>>>> Either or both of these scenarios would default your mechanism.
>>>>
>>>> Maybe I have missed this somewhere - is a pre-loader out of the
>>>> question?
>>>>
>>>> Paul
>>>>
>>>> - Original Message - From: "Karl DeSaulniers"
>>>> 
>>>> To: "Flash Coders List" 
>>>> Sent: Wednesday, April 01, 2009 9:22 AM
>>>> Subject: Re: [Flashcoders] FPS question
>>>>
>>>>
>>>>
>>>>>
>>>>> Anthony,
>>>>> I am going to have to buy you a steak dinner for all the input you
>>>>>  have
>>>>> given me. (unless your vegetarian, then make it a shiitake steak)
>>>>> Your input is right on the money. ;)
>>>>> You basically have said what I was trying to, but my lack of
>>>>>  terminology
>>>>> and experience made it sound like some unfathomable  procedure.
>>>>> The only thing is your getting it backwards on how my movie was going
>>>>>  to
>>>>> play. Oh and I am talking about a Flash swf movie (not video
>>>>> necessarily).
>>>>> The theory about sending some sort of packets to the server and
>>>>> bouncing
>>>>> back what an how to play the swf is what this is really about now that
>>>>> I
>>>>> have read your reply. Thanks. My theory was  to set up a code to read
>>>>> the
>>>>> stream of data coming in to the browser, interp. it, talk to the swf
>>>>> and
>>>>> play the swf faster (skipping frames  as you suggested) if the
>>>>> connection
>>>>> was slow and playing at regular  frame rate when the stream was good.
>>>>> Never
>>>>> playing slow. That is  exactly what I am trying to defeat. The skipping
>>>>> of
>>>>> frames or  increase in fps, which may produce the same, was to give the
>>>>> effect  that nothing had happened when presented with a slow
>>>>> connection.
>>>>> But,  I see what you are saying with combining with a server language
>>>>> to
>>>>>  implement it. Maybe coldfusion? I don't th

Re: [Flashcoders] how can I set the end of a dynamic tween

2009-04-01 Thread Taka Kojima
Sorry Cor,

Don't mean to contradict you, but there is also a
TweenEvent.MOTION_CHANGE event which gets fired whenever the tween
value changes.

Of course, a Timer would work as well.

On Wed, Apr 1, 2009 at 11:53 AM, Cor  wrote:
> Just FYI.
> I guess it depends on what you are trying to achieve.
> With the Timer option you could trace every position of the tween and
> interact on values.
>
>
> -Original Message-
> From: flashcoders-boun...@chattyfig.figleaf.com
> [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Taka Kojima
> Sent: woensdag 1 april 2009 20:43
> To: Flash Coders List
> Subject: Re: [Flashcoders] how can I set the end of a dynamic tween
>
> Actually, probably better off using a TweenEvent, instead of a Timer.
>
> stop();
> import fl.transitions.Tween;
> import fl.transitions.easing.*;
>
>
> var ballXTween:Tween = new Tween(logoCacao, "y",Bounce.easeInOut,
> logoCacao.y,
> 645, 2, true);
>
> ballXTween.addEventListener(TweenEvent.MOTION_FINISH, onComplete);
>
> function onComplete(e:TweenEvent):void{
> removeEventListener(TweenEvent.MOTION_FINISH, onComplete);
> //here is my problem when I try to calculate, when it hits the floor(645)
> if(logoCacao.y>=645){
> trace("I'm here");
> }
>
> }
>
>
> On Wed, Apr 1, 2009 at 11:33 AM, Cor  wrote:
>> Gustavo,
>>
>> The IF statement is over before your logoCacao is on 645 so it is never
>> triggered.
>>
>> Use a timer like this:
>>
>> Var t:Timer = new Timer(10);
>> t.addEventListener(TimerEvent.TIMER, time_tick);
>> t.start();
>>
>> function time_tick(e:TimerEvent):void{
>> if(logoCacao.y>=645){
>> trace("I'm here");
>> t.removeEventListener(TimerEvent.TIMER, time_tick);
>> t.stop();
>> t=null;
>> }
>> }
>>
>> HTH
>> Cor
>>
>>
>> -Original Message-
>> From: flashcoders-boun...@chattyfig.figleaf.com
>> [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Gustavo
>> Duenas
>> Sent: woensdag 1 april 2009 20:12
>> To: Flash Coders List
>> Subject: [Flashcoders] how can I set the end of a dynamic tween
>>
>>
>>
>> Hi Coders I have this code, is for a dynamic tween., pretty easy
>> actually but when the logo hits floor(645 value y) I would like to
>> have something else, because the logo is a movie clip, there is the
>> code.
>>
>> stop();
>> import fl.transitions.Tween;
>> import fl.transitions.easing.*;
>>
>>
>>
>> var ballXTween:Tween = new Tween(logoCacao, "y",Bounce.easeInOut,
>> logoCacao.y,
>> 645, 2, true);
>>
>> //here is my problem when I try to calculate, when it hits the floor
>> (645)
>>
>> if(logoCacao.y>=645){
>> trace("I'm here");
>> }
>>
>> it would work with <=, but no with >= or ==
>> any ideas, I've been trying to resolve this too much time, I rather
>> have some fresh ideas or pointer what am I missing.
>>
>> Gustavo
>>
>>
>>
>>
>>
>> ___
>> Flashcoders mailing list
>> Flashcoders@chattyfig.figleaf.com
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>> No virus found in this incoming message.
>> Checked by AVG - www.avg.com
>> Version: 8.5.278 / Virus Database: 270.11.35/2034 - Release Date: 04/01/09
>> 06:06:00
>>
>> ___
>> 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
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.278 / Virus Database: 270.11.35/2034 - Release Date: 04/01/09
> 06:06:00
>
> ___
> 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] how can I set the end of a dynamic tween

2009-04-01 Thread Taka Kojima
Actually, probably better off using a TweenEvent, instead of a Timer.

stop();
import fl.transitions.Tween;
import fl.transitions.easing.*;


var ballXTween:Tween = new Tween(logoCacao, "y",Bounce.easeInOut, logoCacao.y,
645, 2, true);

ballXTween.addEventListener(TweenEvent.MOTION_FINISH, onComplete);

function onComplete(e:TweenEvent):void{
removeEventListener(TweenEvent.MOTION_FINISH, onComplete);
//here is my problem when I try to calculate, when it hits the floor(645)
if(logoCacao.y>=645){
trace("I'm here");
}

}


On Wed, Apr 1, 2009 at 11:33 AM, Cor  wrote:
> Gustavo,
>
> The IF statement is over before your logoCacao is on 645 so it is never
> triggered.
>
> Use a timer like this:
>
> Var t:Timer = new Timer(10);
> t.addEventListener(TimerEvent.TIMER, time_tick);
> t.start();
>
> function time_tick(e:TimerEvent):void{
> if(logoCacao.y>=645){
> trace("I'm here");
> t.removeEventListener(TimerEvent.TIMER, time_tick);
> t.stop();
> t=null;
> }
> }
>
> HTH
> Cor
>
>
> -Original Message-
> From: flashcoders-boun...@chattyfig.figleaf.com
> [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Gustavo
> Duenas
> Sent: woensdag 1 april 2009 20:12
> To: Flash Coders List
> Subject: [Flashcoders] how can I set the end of a dynamic tween
>
>
>
> Hi Coders I have this code, is for a dynamic tween., pretty easy
> actually but when the logo hits floor(645 value y) I would like to
> have something else, because the logo is a movie clip, there is the
> code.
>
> stop();
> import fl.transitions.Tween;
> import fl.transitions.easing.*;
>
>
>
> var ballXTween:Tween = new Tween(logoCacao, "y",Bounce.easeInOut,
> logoCacao.y,
> 645, 2, true);
>
> //here is my problem when I try to calculate, when it hits the floor
> (645)
>
> if(logoCacao.y>=645){
> trace("I'm here");
> }
>
> it would work with <=, but no with >= or ==
> any ideas, I've been trying to resolve this too much time, I rather
> have some fresh ideas or pointer what am I missing.
>
> Gustavo
>
>
>
>
>
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.278 / Virus Database: 270.11.35/2034 - Release Date: 04/01/09
> 06:06:00
>
> ___
> 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] FPS question

2009-04-01 Thread Taka Kojima
I believe the standard way of handling this is to have three different
versions of your movie.

low, normal and high quality (how you down the file size is totally
dependent on you, could be dropping frames, could be lower rez,
whatever). Which one gets loaded in can be determined by connection
speed, I think this is pretty much the norm way of doing it, and while
Anthony's solution is good in theory, I think it would be too much of
a pain in the ars, not to mention a butt load of server-side
processing every time a user loads your site.

- Taka

On Wed, Apr 1, 2009 at 6:44 AM, Paul Andrews  wrote:
> "default your mechanism"?
>
> LOL "defeat your mechanism"?
>
> Paul
> - Original Message - From: "Paul Andrews" 
> To: "Flash Coders List" 
> Sent: Wednesday, April 01, 2009 1:36 PM
> Subject: Re: [Flashcoders] FPS question
>
>
>> Karl,
>>
>> Despite what has been suggested, this will still only have a chance of
>> working work for some flash Movies written in a certain way. Many of my
>> flash movies are only one frame, sometimes just a handful of frames, so your
>> attempt to smoothly run a high-bandwidth movie on a slow connection would
>> fail for movies like mine - either because they load a lot of assets at a
>> particular frame, or because they load assets via code during the movie.
>> Either or both of these scenarios would default your mechanism.
>>
>> Maybe I have missed this somewhere - is a pre-loader out of the question?
>>
>> Paul
>>
>> - Original Message - From: "Karl DeSaulniers"
>> 
>> To: "Flash Coders List" 
>> Sent: Wednesday, April 01, 2009 9:22 AM
>> Subject: Re: [Flashcoders] FPS question
>>
>>
>>> Anthony,
>>> I am going to have to buy you a steak dinner for all the input you  have
>>> given me. (unless your vegetarian, then make it a shiitake steak)
>>> Your input is right on the money. ;)
>>> You basically have said what I was trying to, but my lack of  terminology
>>> and experience made it sound like some unfathomable  procedure.
>>> The only thing is your getting it backwards on how my movie was going  to
>>> play. Oh and I am talking about a Flash swf movie (not video necessarily).
>>> The theory about sending some sort of packets to the server and bouncing
>>> back what an how to play the swf is what this is really about now that I
>>> have read your reply. Thanks. My theory was  to set up a code to read the
>>> stream of data coming in to the browser, interp. it, talk to the swf and
>>> play the swf faster (skipping frames  as you suggested) if the connection
>>> was slow and playing at regular  frame rate when the stream was good. Never
>>> playing slow. That is  exactly what I am trying to defeat. The skipping of
>>> frames or  increase in fps, which may produce the same, was to give the
>>> effect  that nothing had happened when presented with a slow connection.
>>> But,  I see what you are saying with combining with a server language to
>>>  implement it. Maybe coldfusion? I don't think that PHP could handle  that,
>>> but, I know PEARL could. But I would like to see a flash server  engine
>>> sometime in the near future. Something that launched and  controlled your
>>> own applications for your website and/or a built in  flash database.. hello
>>> Adobe!!!  I wouldn't even mind a component for  that... :P
>>>
>>>
>>> Thanks again,
>>> I think your suggestion has put me on the right path.. once again. :)
>>>
>>> Karl DeSaulniers
>>> Design Drumm
>>> http://designdrumm.com
>>>
>>> On Apr 1, 2009, at 2:50 AM, Anthony Pace wrote:
>>>
 Hi Karl,

 The only way to make 30fps play consistently on a lower bandwidth
 connection, would be to send a message to the server, telling it to send 
 the
 stream at a reduced quality; thus, the size and quality of each frame would
 be greatly reduced on a slow connection.  Yet, if  a pause is acceptable,
  creating a buffer for the content and  playing the buffered content, while
 waiting for new content to  download and be placed in the buffer for later
 playing, would be an  option.  Your suggestion, sounds like it would result
 in you  playing the stream in slow motion.

 Another idea would be to tell the server to reduce the amount, or
 "drop", the frames sent; yet, this would not be 30fps, as the fps  would
 drop based on the users connection.
 E.G.  if 30 fps plays well on 300KB downstream, but the user can  only
 download solidly at 100KB, you could only send approximately  1/3 (maybe
 less to be safe) of the frames safely allocated for that  second while
 ensuring no delays in matching frames to audio;  therefore, frames
 1..4..7..10..13..16..19..22..25..28.. would be  sent per second out of the
 regular 30fps.  (I hope I am not missing  something and sounding stupid
 here)

 This is really just theory, and is easier to say than to put into
 practise; yet, it is not so difficult to figure out, that you  couldn't 
 pull

Re: [Flashcoders] how can I set the end of a dynamic tween

2009-04-01 Thread Taka Kojima
You need to use an event listener, (or if it's as2 assign an
onComplete function). Not to be rude, but you should probably go out
and buy a book on ActionScript -- this is a very basic question, and
where I can answer this in depth, it really won't do you much good in
the long run without a good grasp of basics.

-  Taka

On Wed, Apr 1, 2009 at 11:11 AM, Gustavo Duenas
 wrote:
>
>
> Hi Coders I have this code, is for a dynamic tween., pretty easy actually
> but when the logo hits floor(645 value y) I would like to have something
> else, because the logo is a movie clip, there is the code.
>
> stop();
> import fl.transitions.Tween;
> import fl.transitions.easing.*;
>
>
>
> var ballXTween:Tween = new Tween(logoCacao, "y",Bounce.easeInOut,
> logoCacao.y,
> 645, 2, true);
>
> //here is my problem when I try to calculate, when it hits the floor(645)
>
> if(logoCacao.y>=645){
> trace("I'm here");
> }
>
> it would work with <=, but no with >= or ==
> any ideas, I've been trying to resolve this too much time, I rather have
> some fresh ideas or pointer what am I missing.
>
> Gustavo
>
>
>
>
>
> ___
> 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] AS3: How to check if an URLVariables contains a field?

2009-03-31 Thread Taka Kojima
do:

else if(urlvars.bids != null){
// do this;
}

instead

- Taka

On Tue, Mar 31, 2009 at 1:01 PM, Alexander Farber
 wrote:
> Hello,
>
> I have the following function called repeatedly:
>
>        private function handleComplete(event:Event):void {
>                var urlvars:URLVariables = event.target.data;
> .
>                if (urlvars.lobby) {
> .
>                } else if (urlvars.bids) {
>                        populate(urlvars.bids, User.BIDS);
>                } else if (urlvars.cards) {
>                        populate(urlvars.cards, Card.CARDS);
>                }
>        }
>
> and for some strange reason eventhough
> the urlvars doesn't contain the field "bids"
> (I watch the urlvars in debugger and
> advance step by step), the function
> populate(urlvars.bids, User.BIDS);
> still gets called (and then fails with
> TypeError: Error #1009: Cannot access a property or method of a null
> object reference.
>        at Pref/populate() )
>
> I don't understand why it happens and
> how should I perform the check instead...
>
> Any advices please?
>
> 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] AS3 Object reference

2009-03-30 Thread Taka Kojima
photoStrip_mc["thumbnail" + I]_mc._width

and

photoStrip_mc.thumbnail[I]_mc._width

won't work.

"[]" basically serve the purpose of periods they represent
heirarchy, they don't perform an eval() (there is no AS3 equivalent of
AS2's eval() btw).

You were on the right path with: photoStrip_mc["thumbnail" + i + "_mc"]._width

The only issue I see wrong is using "._width" instead of ".width"

Then again, it is out of context, so I don't know what the rest of
your code is, it might be that you are not properly assigning the
values.

As Muzak mentioned, I also usually just store mc's that I need to loop
through in an array and do it that way.

- Taka

On Mon, Mar 30, 2009 at 12:02 PM, TS  wrote:
> Ok that was my other question. Bouncing back from PHP to AS3 is making me
> insane. Thanks for the info. Arrays are def the way to go.
>
> Thanks again, T
>
>
> -Original Message-
> From: flashcoders-boun...@chattyfig.figleaf.com
> [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Muzak
> Sent: Saturday, March 28, 2009 7:50 PM
> To: Flash Coders List
> Subject: Re: [Flashcoders] AS3 Object reference
>
> 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    var mc:MovieClip = new MovieClip();
>    photoStrip_mc.addChild(mc);
>    myClips.push(mc);
> }
>
>
> If you need to access the clips at some later time, just loop through the
> myClips Array.
>
> var len:uint = myClips.length;
> for(var i:uint=0; i    var mc:MovieClip = myClips[i];
>    mc.width = someValue;
> }
>
> regards,
> Muzak
>
>
> - 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
>
> ___
> 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] ?: how to prevent users to copy text from a TextArea?

2009-03-27 Thread Taka Kojima
Yep, Anthony and I came up with the same solution, except I took it
one step further and wrote the code for it ;)

Note to also take the scrollbars width/height into account (using
textarea.verticalScrollBar/textArea.horizontalScrollBar), just so you
don't create another issue by solving this one

On Fri, Mar 27, 2009 at 2:34 PM, Anthony Pace  wrote:
> I know its a bit hackish but it should work.
>
> You could get the width and height of the text field, and overlay a
> transparent shape that match the dimensions.
>
> pe...@pepo.nl wrote:
>>
>> I'll have to prevent users to copy text from a TextArea. In Flex I saw you
>> do that bij setting a selectable attribute of the mx.controls.TextArea to
>> false.
>>
>> However, this seems not possible with the fl.controls.TextArea, which is
>> used in Flash CS4 / AS3.
>>
>> Does someone has a tip or hint.
>> Thanks.
>>
>> PS. setting editable of the TextArea to false doesn't help, and setting
>> the enabled attribute of the TextArea to false gives a disabled look and is
>> not the intention.
>>
>> Peter van der Post
>>
>>
>>
>> ___
>> Flashcoders mailing list
>> Flashcoders@chattyfig.figleaf.com
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


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

2009-03-27 Thread Taka Kojima
Hey Peter,

Hmm... i see the issue, very weird, probably classifies as a bug,
here's how I got around it:

public function DistributorsForm () :void {
   // sets styles ... set size =14 instead of default 16...
   StyleFlair.snapOnTextArea(details_ta, {size:14});
   details_ta.textField.selectable = false;

var details_ta_overlay:Sprite = new Sprite();

details_ta_overlay.graphics.beginFill(0xFF, 0);
details_ta_overlay.graphics.drawRect(details_ta.x, details_ta.y,
details_ta.width - details_ta.verticalScrollBar.width,
details_ta.height - details_ta.horizontalScrollBar.height);
details_ta_overlay.graphics.endFill();

addChild(details_ta_overlay);
}


you could even extend TextArea to override the selectable setter to do
this or something, I'm sure there is a better/cleaner way to implement
this , but hey it works right?

Hope this helps.

 - Taka

On Fri, Mar 27, 2009 at 2:14 PM,   wrote:
> Joel, Ian,
>
> I agree with you, because I thought I was doing it "by the book" (=AS3
> Reference).
>
> Thanks, you are willing to look at the code. Code is included however it is
> extracted from the source files and not a working standalone example.
>
> I extracted everything what is done with the details_ta TextArea-instance.
> The details_ta is on the stage before the code is exectued. I compile all
> code in Flex Builder 3 in a SWC-file which I link in as Library in Flash FLA
> (Flash CS4), if that matters.
>
> Text in the details_ta, when Test movie is executed, can be selected and
> copied. I'll hope the code can help.
>
> Code:
>
> package {
>
>  import fl.controls.TextArea;
>  import flash.display.*;
>  import flash.events.*;
>  import flash.text.TextField;
>
>  public class DistributorsForm extends ModuleTemplate  {
>     public var details_ta:TextArea; // for displaying the list
>     public function DistributorsForm () :void {
>        // sets styles ... set size =14 instead of default 16...
>        StyleFlair.snapOnTextArea(details_ta, {size:14});
>        details_ta.textField.selectable = false;
>     }
>
>     // MUTATOR for the information GUI widget...
>     public function set detailsWidget(s:String):void {
>        details_ta.htmlText = s;
>     };
>
>    private function showDetails(distributors:Array) : void {
>        var s:String = "";
>        for each (var d:Distributor in distributors) {
>           s = s.concat( htmlFormat(d), "");
>        }
>        detailsWidget = s; // display the data
>        }
>
>        private function htmlFormat(d:Distributor):String {
>          var blueColorFont:String = "";
>          var BREAK:String = "";
>          var endFont:String = "";
>
>          // format details ...
>          var details:String;
>                details  = "" + d.companyname + "";
>                details += d.contactperson + BREAK;
>                details += d.address + BREAK;
>                details += d.city + BREAK;
>                details += d.telephone + BREAK;
>                return details;
>        }
>
>   } // endof class
> } // endof package
>
>
>
> class StyleFlair {
>
>   public static function snapOnTextArea(ta:TextArea,
>                                  formatObj:Object=null):void {
>       // set default format values, or have them override with formatObj
>       var size:uint = 16;
>        var color:String = "0xFF";
>        if (formatObj != null) {
>           if (formatObj.size != null) size = formatObj.size;
>           if (formatObj.color != null) color = formatObj.color;
>           if (formatObj.font != null) font = formatObj.font;
>        }
>        ta.editable = false;
>        ta.enabled  = false;
>        ta.setStyle("marginRight", 1);
>        ta.setStyle("marginLeft", 1);
>        var format:TextFormat = new TextFormat();
>        format.font = font ;
>        format.color = color;
>        format.size = size;
>        ta.setStyle("textFormat", format);
>    }
> }
>
> class moduleTemplate is not shown but does do anything with details_ta, or
> formatting components.
>
> Peter
>
> Citeren Joel Stransky :
>
>> Somehow I doubt that.
>> How about posting your code so there's no confusion.
>>
>> On Fri, Mar 27, 2009 at 3:36 PM,  wrote:
>>
>>> Joel,
>>>
>>> Thanks, however that didn't work.
>>> (sorry if I was not clear in my response on Ian's hint, because what you
>>> wrote was exactly what I did)
>>>
>>> Still no joy ...
>>>
>>> Peter
>>>
>>> Citeren Joel Stransky :
>>>
>>>
>>>  Target the TextArea's TextField

 details_ta.textField.selectable = false;

 On Fri, Mar 27, 2009 at 2:39 PM,  wrote:

  Ian,
>
> thanks for replying. Unfortunately noop.
>
> I use the htmlText property of the TextArea instance instead of the
> text
> prioperty to display text (such as details_ta.htmlText = "text
> sample"; and details_ta is an TextArea instance on the stage).
>
> Could that something have to do with it?
>
> Peter
>
> Citere

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

2009-03-27 Thread Taka Kojima
Damn formatting

public function DistributorsForm () :void{
// sets styles ... set size =14 instead of default 16...
StyleFlair.snapOnTextArea(details_ta, {size:14});
details_ta.textField.selectable = false;

var details_ta_overlay:Sprite = new Sprite();

details_ta_overlay.graphics.beginFill(0xFF, 0);
details_ta_overlay.graphics.drawRect(details_ta.x, details_ta.y,
details_ta.width - details_ta.verticalScrollBar.width,
details_ta.height - details_ta.horizontalScrollBar.height);
details_ta_overlay.graphics.endFill();

addChild(details_ta_overlay);
}


On Fri, Mar 27, 2009 at 2:38 PM, Taka Kojima  wrote:
> Hey Peter,
>
> Hmm... i see the issue, very weird, probably classifies as a bug,
> here's how I got around it:
>
> public function DistributorsForm () :void {
>   // sets styles ... set size =14 instead of default 16...
>   StyleFlair.snapOnTextArea(details_ta, {size:14});
>   details_ta.textField.selectable = false;
>
>        var details_ta_overlay:Sprite = new Sprite();
>
>        details_ta_overlay.graphics.beginFill(0xFF, 0);
>        details_ta_overlay.graphics.drawRect(details_ta.x, details_ta.y,
> details_ta.width - details_ta.verticalScrollBar.width,
> details_ta.height - details_ta.horizontalScrollBar.height);
>        details_ta_overlay.graphics.endFill();
>
>        addChild(details_ta_overlay);
> }
>
>
> you could even extend TextArea to override the selectable setter to do
> this or something, I'm sure there is a better/cleaner way to implement
> this , but hey it works right?
>
> Hope this helps.
>
>  - Taka
>
> On Fri, Mar 27, 2009 at 2:14 PM,   wrote:
>> Joel, Ian,
>>
>> I agree with you, because I thought I was doing it "by the book" (=AS3
>> Reference).
>>
>> Thanks, you are willing to look at the code. Code is included however it is
>> extracted from the source files and not a working standalone example.
>>
>> I extracted everything what is done with the details_ta TextArea-instance.
>> The details_ta is on the stage before the code is exectued. I compile all
>> code in Flex Builder 3 in a SWC-file which I link in as Library in Flash FLA
>> (Flash CS4), if that matters.
>>
>> Text in the details_ta, when Test movie is executed, can be selected and
>> copied. I'll hope the code can help.
>>
>> Code:
>>
>> package {
>>
>>  import fl.controls.TextArea;
>>  import flash.display.*;
>>  import flash.events.*;
>>  import flash.text.TextField;
>>
>>  public class DistributorsForm extends ModuleTemplate  {
>>     public var details_ta:TextArea; // for displaying the list
>>     public function DistributorsForm () :void {
>>        // sets styles ... set size =14 instead of default 16...
>>        StyleFlair.snapOnTextArea(details_ta, {size:14});
>>        details_ta.textField.selectable = false;
>>     }
>>
>>     // MUTATOR for the information GUI widget...
>>     public function set detailsWidget(s:String):void {
>>        details_ta.htmlText = s;
>>     };
>>
>>    private function showDetails(distributors:Array) : void {
>>        var s:String = "";
>>        for each (var d:Distributor in distributors) {
>>           s = s.concat( htmlFormat(d), "");
>>        }
>>        detailsWidget = s; // display the data
>>        }
>>
>>        private function htmlFormat(d:Distributor):String {
>>          var blueColorFont:String = "";
>>          var BREAK:String = "";
>>          var endFont:String = "";
>>
>>          // format details ...
>>          var details:String;
>>                details  = "" + d.companyname + "";
>>                details += d.contactperson + BREAK;
>>                details += d.address + BREAK;
>>                details += d.city + BREAK;
>>                details += d.telephone + BREAK;
>>                return details;
>>        }
>>
>>   } // endof class
>> } // endof package
>>
>>
>>
>> class StyleFlair {
>>
>>   public static function snapOnTextArea(ta:TextArea,
>>                                  formatObj:Object=null):void {
>>       // set default format values, or have them override with formatObj
>>       var size:uint = 16;
>>        var color:String = "0xFF";
>>        if (formatObj != null) {
>>           if (formatObj.size != null) size = formatObj.size;
>>           if (formatObj.color != null) color = formatObj.color;
&

Re: [Flashcoders] timeline methods fail on embedded swf

2009-03-26 Thread Taka Kojima
nevermind, i didn't fully read your example, though it might be a
related issue, it's probably not the same...

Although, seeing as they have similar outcomes, maybe what I said will
help you in further debugging the isssue.

On Thu, Mar 26, 2009 at 12:05 PM, Taka Kojima  wrote:
> Not sure if this is the issue, but it sure does sound like it.
>
> Does embed.swf have a base class?
>
> The issue I ran into caused all of my timeline code to not execute,
> i.e. fail silently, which seems to be what is happening with you.
>
> The problem was that I couldn't import the external.swf's base class
> and type cast the external.swf as that class in the class that loads
> it in (if it's a local class casting something as ":Class", you're
> importing it)...
>
> That's a bit of a run-on sentence, and it may or may not make
> sense i'll give you an example to try to clarify:
>
> Let's say external.swf's base class is External...
>
> If you do:
>
> var _loader:Loader = new Loader();
> _loader.contentLoaderInfo.addEventListener( Event.COMPLETE, loadingComplete );
> _loader.load( new URLRequest( "external.swf" ) );
>
> function loadingComplete(e:Event):void{
> addChild(_loader.content);
> }
>
> The timeline code will execute, however, if you do:
>
> var _loader:Loader = new Loader();
> _loader.contentLoaderInfo.addEventListener( Event.COMPLETE, loadingComplete 
> );;
> _loader.load( new URLRequest( "external.swf" ) );
>
> function loadingComplete(e:Event):void{
> var external = External(addChild(_loader.content));
> }
>
> The timeline code will not execute.
>
> Obviously, this is a bit of an issue as you cannot correctly typecast
> your external swf's and have timeline code run inside of them.
>
> The way I got around this was changing External to ExternalBase and
> then creating a new External class -- I then set the document base
> class of external.swf to "External" and typecasted it by doing var
> external = ExternalBase(addChild(_loader.content));
>
>
> Hope this helped.
>
> On Thu, Mar 26, 2009 at 11:50 AM, Eric Costello  wrote:
>> Hello flashcoders,
>>
>> Consider the following as3 file, built for flash 10 with mxmlc; it
>> embeds a swf built with Flash CS4 which contains a simple motion
>> tween:
>>
>> package {
>>
>>        import flash.display.*
>>
>>        public class Test extends MovieClip {
>>
>>                [Embed(source="embed.swf")]
>>                public var embed:Class;
>>
>>                public function Test():void {
>>                        var m:MovieClip = MovieClip(addChild(new element()));
>>                        m.stop(); // fails
>>                        m.y=100; // works
>>                }
>>
>>        }
>>
>> }
>>
>> Why is m.stop() ignored? No errors generated, it just does not stop
>> the embedded swf's timeline from advancing. (All timeline methods fail
>> silently: stop, gotoAndStop, etc.)
>>
>> Any pointers on what I'm doing wrong?
>>
>> TIA,
>> Eric
>> ___
>> 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] timeline methods fail on embedded swf

2009-03-26 Thread Taka Kojima
Not sure if this is the issue, but it sure does sound like it.

Does embed.swf have a base class?

The issue I ran into caused all of my timeline code to not execute,
i.e. fail silently, which seems to be what is happening with you.

The problem was that I couldn't import the external.swf's base class
and type cast the external.swf as that class in the class that loads
it in (if it's a local class casting something as ":Class", you're
importing it)...

That's a bit of a run-on sentence, and it may or may not make
sense i'll give you an example to try to clarify:

Let's say external.swf's base class is External...

If you do:

var _loader:Loader = new Loader();
_loader.contentLoaderInfo.addEventListener( Event.COMPLETE, loadingComplete );
_loader.load( new URLRequest( "external.swf" ) );

function loadingComplete(e:Event):void{
addChild(_loader.content);
}

The timeline code will execute, however, if you do:

var _loader:Loader = new Loader();
_loader.contentLoaderInfo.addEventListener( Event.COMPLETE, loadingComplete );;
_loader.load( new URLRequest( "external.swf" ) );

function loadingComplete(e:Event):void{
var external = External(addChild(_loader.content));
}

The timeline code will not execute.

Obviously, this is a bit of an issue as you cannot correctly typecast
your external swf's and have timeline code run inside of them.

The way I got around this was changing External to ExternalBase and
then creating a new External class -- I then set the document base
class of external.swf to "External" and typecasted it by doing var
external = ExternalBase(addChild(_loader.content));


Hope this helped.

On Thu, Mar 26, 2009 at 11:50 AM, Eric Costello  wrote:
> Hello flashcoders,
>
> Consider the following as3 file, built for flash 10 with mxmlc; it
> embeds a swf built with Flash CS4 which contains a simple motion
> tween:
>
> package {
>
>        import flash.display.*
>
>        public class Test extends MovieClip {
>
>                [Embed(source="embed.swf")]
>                public var embed:Class;
>
>                public function Test():void {
>                        var m:MovieClip = MovieClip(addChild(new element()));
>                        m.stop(); // fails
>                        m.y=100; // works
>                }
>
>        }
>
> }
>
> Why is m.stop() ignored? No errors generated, it just does not stop
> the embedded swf's timeline from advancing. (All timeline methods fail
> silently: stop, gotoAndStop, etc.)
>
> Any pointers on what I'm doing wrong?
>
> TIA,
> Eric
> ___
> 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] Tween AS3 issue with Firefox

2009-03-26 Thread Taka Kojima
It's especially great when you take the time to respond to somebody
and they don't even read your response, or if they do, they don't
respond back.

On Thu, Mar 26, 2009 at 10:46 AM, Muzak  wrote:
>> 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
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Flash-HTML WYIWYG editor?

2009-03-25 Thread Taka Kojima
I use TinyMCE for a lot of flash based wysiwyg text fields, I only
allow simple tags, but bold, italic, underline and links work, as well
as line breaks and paragraphs, etc.

even 's work.

Work's like a charm and have had no problems.

- Taka


On Wed, Mar 25, 2009 at 2:35 PM, Ian Thomas  wrote:
> On Wed, Mar 25, 2009 at 9:30 PM, Mindshare Studios
>  wrote:
>
>> So, we need something like the open source editors TinyMCE or FCKEditor,
>> that *only* allows users to format text using HTML tags that Flash can
>> handle. There are tons of plug and play WYSIWYG editors out there but so far
>> I can't find any geared towards Flash.
>
> I may be misremembering - but I thought that one of the two (TinyMCE
> or FCKEditor, I forget which one) allowed you to restrict which tags
> were allowed somewhere in their config? It has been ages since I used
> either, so I may be mistaken...
>
> HTH,
>  Ian
> ___
> 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] AS3, player 9, security problem, flash AS3 project

2009-03-25 Thread Taka Kojima
http://www.adobe.com/devnet/flash/articles/fplayer8_security_07.html

In order to enable local-with-filesystem, you have to add a
System.security.allowDomain("*") -- although since you are running the
swf on a local webserver (i.e. localhost or 127.0.0.1), I don't think
it treats it as a "local swf", so if you run the swf from your
filesystem, i.e. browse to it in Finder, and open it that way, it
should work.

- Taka

On Wed, Mar 25, 2009 at 9:48 AM, Pavel Krusek  wrote:
> Hi,
>
> i have main.swf file, into it it is loading another swf with
> additional items (png, xml,..). The another swf is loaded but not
> external images, xml etc. Flash output says that there is security /
> sandbox violation problem. Does anybody has any idea?
>
> thanks
>
> *** Security Sandbox Violation ***
> Connection to 
> file:///Macintosh%20HD/Users/pavelkrusek/projects/mama%5Fflash/Devel/src/data/floor_base.png
> halted - not permitted from http://localhost:3000/RoomPlanner.swf
> -- Remote SWFs may not access local files.
> SecurityError: Error #2148: SWF file
> http://localhost:3000/RoomPlanner.swf cannot access local resource
> file:///Macintosh%20HD/Users/pavelkrusek/projects/mama%5Fflash/Devel/src/data/floor_base.png.
> Only local-with-filesystem and trusted local SWF files may access
> local resources.
>        at flash.display::Loader/flash.display:Loader::_load()
>        at flash.display::Loader/load()
>        at com.eurorscg.DM.RoomPlanner::RoomObject$iinit()
>        at com.eurorscg.DM.RoomPlanner::FloorTile$iinit()
>        at com.eurorscg.DM.RoomPlanner::RoomLayout/::buildFloor()
>        at com.eurorscg.DM.RoomPlanner::RoomLayout$iinit()
>        at com.eurorscg.DM.RoomPlanner::Editor$iinit()
>        at RoomPlanner/::buildEditor()
>        at RoomPlanner$iinit()
>
> --
> Pavel Krusek
> ___
> 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 Taka Kojima
Well, banner ads usually have a 50 k cap size limit, rich media
usually caps it at around 150-200k, I don't think you can even
accomplish what you want to accomplish with Unity within that size
limit anyways.

On Fri, Mar 20, 2009 at 3:27 PM, Joel Stransky  wrote:
>>
>> Banner ads, really??
>>
> Yeah banner ads. Or whatever the case may be. I don't just shell out flash
> on a whim, only if it's the only platform that can achieve my clients needs.
> We've always wanted a good 3d solution and even Anark guys are moving over
> to Unity. Just saying it'd be nice to have that option should the need
> arise.
>
> On Fri, Mar 20, 2009 at 5:51 PM, Muzak  wrote:
>
>> 
>> 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" <
>> stranskydes...@gmail.com>
>> 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
>>
>
>
>
> --
> --Joel Stransky
> stranskydesign.com
> ___
> 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 Taka Kojima
Unity is pretty kick-ass, but Unity != Flash

They serve two different purposes. Unity is a multiplatform game
development tool, whereas Flash is more encompassing -- i.e. it is not
strictly a gaming platform, in fact though it is used quite a bit for
online games, that is not its main purpose.

You can't build a website in Unity... therefore, the only real
semi-contender to Flash is Silverlight, I really don't think Flash is
in too much danger at the moment.



On Fri, Mar 20, 2009 at 11:32 AM, Joel Stransky
 wrote:
> Disk space will be the least of all issues. What you say about Quark is
> quite relevant. I would say it's already happening. I'd have never become a
> developer if it weren't for the actionscript 1.0 on-ramp. But after 9 years,
> I'm seriously considering a move to full time Unity development. There's no
> reason at all that Unity can't experience the same ubiquity as the
> flashplayer with a more seamless installer. Once macromedia started the
> built in upgrading with fp v6, new version adoption sped up dramatically.
> The recently released fp10 penetration numbers are impressive to say the
> least.
>
> More on point, the lack of flashplayer on iPhone is purely control and well
> within Apple's rights. I support lawful profit security. But it does not
> close the gate completely on porting actionscript/flex based apps to the
> iPhone. Just yesterday I was reading
> hereabout
> C++ conversion. You all remember the Quake demo I'm sure. There's no
> secret agreement between Unity and Apple that I know of, Unity has simply
> created a great compiler for an already supported language. I think it's
> quite possible to create a similar tool for actionscript and flex.
>
> On Fri, Mar 20, 2009 at 10:04 AM, Glen Pike wrote:
>
>>
>>  Naturally, to get the optimum feature set you will need to buy the whole
>>> A-Phone suite, A-SatNav, A-PhotoDevice, etc to get the best from the
>>> A-Phone, further slimming the wallet. On the downside you will require a
>>> pocket a foot square to put it all in..  ;-)
>>>
>> And another pocket a foot square for the hard disk needed to install all
>> the common files...
>>
>> ___
>> Flashcoders mailing list
>> Flashcoders@chattyfig.figleaf.com
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>
>
>
> --
> --Joel Stransky
> stranskydesign.com
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>

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


[Flashcoders] AS3 Image Cropper

2009-03-20 Thread Taka Kojima
Hey Everybody,

I just finished putting together an image cropper in AS3.

http://www.gigafied.com/dev/cropper/

Wanted to get some peer-developer feedback and if you have any
suggestions on improving it, notice anything wrong, etc.

The window is scalable, i.e. you can resize the window and the
contents will fill the screen, also, saving is not hooked up yet.

Any thoughts/feedback would be appreciated.

- Taka

p.s. if you upload an image 1 mb+ it seems to perpetually keep
"loading", so large images won't work atm.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Looking for a configurable Flash Live Chat Box With Rooms Optional

2009-03-17 Thread Taka Kojima
I built a flash chat room client (using the Flash IDE) about 3 months
ago using Jabber (OpenFire) as the chat server and the XIFF API

http://www.igniterealtime.org/projects/xiff/

The only real issue I ran into was that the XIFF API uses native Flex
classes, so I had to figure out how to get those into a format I could
use in Flash.

In the end, I found a solution that enabled me to compile all of the
neccessary Flex classes in to an swc and use them as an RSL, worked
like a charm. I didn't have to modify any of the API source code, or
the code on the Flex classes either.

The XIFF API makes it easy, all in all I got it done in about 3 days.
Granted, it's not the most feature rich chat client, but basic
functionality is there.

http://gigafied.blogspot.com/2008/12/using-flex-classes-in-flash-cs3.html
(here's my post on getting Flex classes into the Flash IDE).

- Taka

On Tue, Mar 17, 2009 at 4:33 PM, Glen Pike  wrote:
> Hi,
>
>   I found this a few years ago which worked out of the box.
>     http://www.tufat.com/s_flash_chat_chatroom.htm
>     It's a bit cheeky tho' because the guy is packaging up some stuff with
> AMFPHP and not honouring the license properly...
>
>   Glen
>
> TS wrote:
>>
>> Does anyone have a good link to something like this for reasonable price
>> or
>> free?
>>
>> Configurable meaning skinnable and sizeable?
>>
>> Thank you everyone :)
>>
>> ___
>> Flashcoders mailing list
>> Flashcoders@chattyfig.figleaf.com
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>>
>>
>
> --
>
> Glen Pike
> 01326 218440
> www.glenpike.co.uk 
>
> ___
> 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] problem with a loaded external swf

2009-03-17 Thread Taka Kojima
Gustavo,

Unlike AS2, in AS3 loading external clips into MovieClips does not add
the MovieClip's children/properties to the root of the containing MC.

Also, you are essentially adding a Loader component, instead of a
MovieClip, you probably want to do loader.content instead (which isn't
populated until the COMPLETE event is fired). So it would be something
like this:

var loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.load(new URLRequest("myswf.swf"));

function completeHandler(e:Event):void{
var newMC:MovieClip = MovieClip(loader.content);
stage.addChild(newMC);
newMC.closing.buttonMode=true;
}


Something like that should work.

On Tue, Mar 17, 2009 at 12:19 PM, Gustavo Duenas
 wrote:
>
>
>
> Hi coders, I have a externally loaded swf which loads inside a movie clip
> but I don't know how to instruct the button inside of the loade swf to have
> eventlisteners, anyone knows?
>
> this is pretty much my code:
>
> function creatis(e:MouseEvent):void{
>
> var newMC:MovieClip = new MovieClip();
> var newLoader:Loader = new Loader();
> newLoader.load(new URLRequest("myswf.swf"));
> newMC.addChild(newLoader);
> //so far here it loads.
> stage.addChild(newMC);
> //so far we have the swf in the stage
>
> newMC.closing.buttonMode=true;
> //here it says that a elemtn doesn't have a property and is undefined, but
> is inside the  external swf, exist the movieclip closing
>
>
> }
>
> here it is, I hope you could help me out, I've been hours with this.
>
> regards,
>
>
> Gustavo
>
> ___
> 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] how to get all the mc's that have a .onRelease event

2009-03-12 Thread Taka Kojima
Hmm

Doesn't sound like the most efficient way to go about solving the
issue you are trying to resolve (which I don't know, but I can guess
what it is).

>From what I know, you'd have to manually add those to an array, you
can do that by adding a function like registerEventListener(type,
listener, mc) that would do the addEventListener and then add it to an
array which you can loop through later.

However, if you are just trying to disable all the clickable things in
your movie when let's you are waiting for a response back from your
server, i would just overlay an mc that spans the entire canvas and
set that mc's mouseChildren property to false, which would effecitvely
render all your buttons/mcs with click events unable to receive those
events.

If it's AS2 (not AS3), you can use the same approach, but you don't
have to set the mouseChildren property as obviously any mc's
underneath wouldn't be clickable.

- Taka

On Thu, Mar 12, 2009 at 2:18 PM, Marcelo Wolfgang  wrote:
> Hi all,
>
> Well the title says everthing, I need to know if I can loop over all
> mc's in a movie and add them to an array so I can enable/disable the
> onRelease event based on some conditions.
>
> TIA
> Marcelo Wolfgang
> ___
> 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] GetDefenitionByName from loaded SWF

2009-03-12 Thread Taka Kojima
add a public static var instance:ParentClass to the ParentClass file...

Then in the constructor, do instance = this;

Then you should be able to access everything by doing
ParentClass.instance.propertyName;

- Taka

On Thu, Mar 12, 2009 at 10:11 AM, Helmut Granda
 wrote:
> Hello All,
> I am trying to access properties from a child file. This is the set up:
>
>>Parent
>>>loadedA.swf // gets loaded into Parent
>>>loadedB.swf // gets loaded into Parent
>
> Parent has a static class called "ParentClass" and it has about 10 mutators
> that I want to access through the child movies being loaded (loadedA,
> loadedB).
>
> After the files are being loaded I am using ApplicationDomain to let the
> child movies know where ParentClass lives since they do not get added to the
> display list until later but they need information that the ParentClass have
> to work properly and that is why they do have access to it.
>
> So like I said, the child movies have access to ParentClass but all the
> properties return undefined or null.
>
> Anyone has any recommendations?
>
> TIA
> ___
> 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] include directive ...

2009-03-06 Thread Taka Kojima
Keep it on the timeline, don't switch to external AS files unless you
want to give yourself suicide thoughts ;)

If you wanted to switch over to using classes, that's a different
story, but for only 10-30 lines per movieclip on the timeline, I'd say
just keep going with how you're doing it. It is working right?

In terms of the Flash AS editor -- I agree, it is a POS, but I set my
own color scheme and everything so mine's all tricked out and it's not
half as bad as it is with default settings ;)

- Taka

On Fri, Mar 6, 2009 at 11:34 AM, Joel Stransky  wrote:
> Hahaha. FlashDevelop pwns you!
>
> On Fri, Mar 6, 2009 at 1:55 PM, whispers  wrote:
>
>> P.O.S. Actions panel 4 LIFE!!!
>>
>>
>> :)
>>
>> -Original Message-
>> From: flashcoders-boun...@chattyfig.figleaf.com
>> [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Joel
>> Stransky
>> Sent: Friday, March 06, 2009 11:58 AM
>> To: Flash Coders List
>> Subject: Re: [Flashcoders] include directive ...
>>
>> Technically, Yes, it's the exact same thing. include merely allows you use
>> an external text editor instead of the p.o.s. actions panel.
>>
>>
>> On Wed, Mar 4, 2009 at 10:27 PM, Paul Andrews  wrote:
>>
>> > The include directive is just plain text inclusion from an external
>> source.
>> > Once included it's as though it were inline.
>> >
>> > I think that if you are using the timeline and having lots of includes
>> > all over the place to replace all of the inline code, it would be a
>> > nightmare to work out what's going on.
>> >
>> > I rarely use the include directive. Better to use classes.
>> >
>> > Paul
>> >
>> >
>> > - Original Message - From: "SJF" 
>> > To: 
>> > Sent: Thursday, March 05, 2009 2:37 AM
>> > Subject: [Flashcoders] include directive ...
>> >
>> >
>> >
>> >  Looking for clarity on the include directive in a CS3 FLA file.
>> >>
>> >> Technically, does anyone know if pound-for-pound, having code on a
>> >> movieclip's timeline is EXACTLY the same as having it's code in an
>> >> external .as file and using the include directive?
>> >>
>> >> Here are more details:
>> >>
>> >> 1) The code being externalised contains imports, variable
>> >> declarations, numerous functions and runtime code (approx. 150-250
>> >> lines of code)
>> >> 2) The movieclip is dynamic and created on the fly by the
>> >> application, putting the movieclip within various other movieclips
>> >> deep in the display stack
>> >> 3) Multiple other movieclips (approx. 30) also contain code with
>> >> imports, variable declarations, functions and runtime code
>> >>
>> >> So the question I ask:
>> >>
>> >> Is it technically possible to externalise all code in a CS3 FLA
>> >> document by exporting all code from all timelines and using the
>> >> include directive?
>> >>
>> >> Are there issues with instantiation of objects/classes or problems
>> >> with import paths, etc?
>> >>
>> >> Thoughts?
>> >> ___
>> >> 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
>> >
>>
>>
>>
>> --
>> --Joel Stransky
>> stranskydesign.com
>> ___
>> 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
>>
>
>
>
> --
> --Joel Stransky
> stranskydesign.com
> ___
> 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] [AS3] Dynamic and Static text field font conflict work arounds

2009-03-04 Thread Taka Kojima
ahh...

I would use a tool like TypeTool to create a "new" version of the
font, use one for static and one for embedding...

However, why not just set your static textFields to dynamic...

You can use the font in your library by setting the font to exportName*

- Taka

On Wed, Mar 4, 2009 at 12:02 PM, Joel Stransky  wrote:
> Sorry I meant exported fonts that are in turn applied to a dynamic textField
> whose embedFonts property is set to true.
>
> On Wed, Mar 4, 2009 at 2:41 PM, Taka Kojima  wrote:
>
>> what's the exact bug, because I just created two text fields, one with
>> static text, the other dynamic. I embedded the font in the dynamic
>> text field and it worked...
>>
>>
>>
>> On Wed, Mar 4, 2009 at 11:16 AM, Joel Stransky 
>> wrote:
>> > I've finally run into a situation where I really need the same font both
>> > embeded and used statically.
>> > I've been searching the web and there a lots of mentions of the bug but
>> I've
>> > yet to find a great work around.
>> > Does anyone have a preferred or elegant fix they can recommend?
>> >
>> > --
>> > --Joel Stransky
>> > stranskydesign.com
>> > ___
>> > 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
>>
>
>
>
> --
> --Joel Stransky
> stranskydesign.com
> ___
> 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] [AS3] Dynamic and Static text field font conflict work arounds

2009-03-04 Thread Taka Kojima
what's the exact bug, because I just created two text fields, one with
static text, the other dynamic. I embedded the font in the dynamic
text field and it worked...



On Wed, Mar 4, 2009 at 11:16 AM, Joel Stransky  wrote:
> I've finally run into a situation where I really need the same font both
> embeded and used statically.
> I've been searching the web and there a lots of mentions of the bug but I've
> yet to find a great work around.
> Does anyone have a preferred or elegant fix they can recommend?
>
> --
> --Joel Stransky
> stranskydesign.com
> ___
> 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] And another one re: try-catch-finally statements

2009-03-03 Thread Taka Kojima
Not saying it's a good thing, just laying out what it's accomplishing.

Seeing as Flash generates some pretty ugly looking runtime errors, I
usually like to display errors on my own terms, such as

catch (err:Error){
ErrorManager.showError("There was a problem communicating with the
server, please try again later");
 }

On Tue, Mar 3, 2009 at 7:19 PM, Dave Watts  wrote:
>> Now considering there is no code in the 'catch' block,
>> there can be absolutely no benefit whatsoever to using
>> try-catch-finally in the above instance.
>
> Well, it'll swallow the exception; that might be considered by some to
> be a benefit, although it's bad form to handle exceptions that way.
>
> 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!
> - Show quoted text -
> ___
> 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] And another one re: try-catch-finally statements

2009-03-03 Thread Taka Kojima
Actually, in some instances that block of code might generate a
runtime error, in which case, to prevent Flash from outputting the
runtime error, there is a try catch block.



On Tue, Mar 3, 2009 at 7:02 PM, SJF  wrote:
> I have a head-cold (hence the possibly obvious answer to this question) and
> a block of code as such:
>
> function checkResponder(e:Event = null):void
> {
>  try
>  {
>  bPollingDatabase = true;
>  updateListArray();
>  }
>  catch (err:Error)
>  {
>  //
>  }
> }
>
> Now considering there is no code in the 'catch' block, there can be
> absolutely no benefit whatsoever to using try-catch-finally in the above
> instance.
>
> Is this correct?
> ___
> 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] accessing a function from a movieclip

2009-03-02 Thread Taka Kojima
Hey Rein,

It's not totally clear what you're trying to do...

So, startVideo() is a function of con_video, correct?

Where are you trying to call the function from? If con_video is a
child of where you are calling the function from, you can use
parent.parent (as many levels as you need) to do it.

Otherwise, I would create a document base class for your FLA, then you
can do something like Site.con_video (if con_video is a static var) or
Site.instance.con_video

Taka

On Mon, Mar 2, 2009 at 12:07 PM, Reina Lyn Ben  wrote:
> can any one help me with this code:
> MovieClip(root).con_video.AVplayer.startVideo();
> I am trying to access a function from a movieclip. This code is not located
> on the stage or root, it is located at con_video.  (^^,)
>
> Thanks,
> Rein
>
> --
> 
>
> Reina Lyn Ben
> Flash Web Devsigner
>
> Web Portfolio:  www.ReinaLynBen.com 
> ___
> 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] drag along custom path

2009-02-25 Thread Taka Kojima
Mouse.startDrag()

Mouse.stopDrag()

startDrag() takes boundaries as an argument, just look it up in help,
it's pretty straightforward.

- Taka

On Wed, Feb 25, 2009 at 6:52 PM, Tom Huynen  wrote:
> Hi guys,
>
> I'm trying to drag a sprite along a rectangle with rounded corners. Does
> anybody know an easy way to do this?
>
> Kind regards,
>
> Tom
> ___
> 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] xml and e4x searching question

2009-02-19 Thread Taka Kojima
When you trace out:

trace(staff.*.(POSITION == "Designer"));

You will see that it returns the parent  element... So, even
if your code were to work, all it would do would be to return the root
 node, which probably wouldn't help you.

If you compare the two examples, you will see that there is only one
 node within each  node...

If you modify the staff XML to be:

   var staff:XML = 

   Marco Crawley
   James Crawley
   Designer
   Programmer

 

It will no longer work.

Also, you should be using attributes as opposed to entering values
directly into nodes. I personally never filter e4x through the node
value, but rather through attribute values, like so...

var staff2:XML=
fred
bob
leroy
algernon


 trace("find leroy: " +staff2.*.(@name=="leroy").toXMLString());


Hope this helps.

- Taka

On Thu, Feb 19, 2009 at 5:22 PM, Ferd Berfel  wrote:
> hello,  newbie here...
>
>
> I'm trying to understand searching xml with e4x
>
> why does this work:
>
>var staff:XML = 
> 
>Marco Crawley
>James Crawley
>Designer
> 
>  
>
> var results:XMLList= staff.*.(POSITION == "Designer")
>
> and this does not?
>
> var staff2:XML=
>  fred
>  bob
> leroy
> algernon
> 
>
>  trace("find leroy: " +staff2.(EMPLOYEE=="leroy"));
>
> but more importantly, how WOULD I find leroy?  (I know I can create a
> function to loop through children, but I'm wondering how to do it within the
> format describe)
>
>
> tia
> ferd
> ___
> 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] component def doesn't pass params to constructor?

2009-02-19 Thread Taka Kojima
Gregory,

A lot of times, I do something like...

private var propsSet:Array = new Array();

public function set ballType(_value:String):void{
_ballType= _value;
propsSet.push("ballType");
checkProps();
}

private function checkProps():void{
if(propsSet.length >= 12){
// do Blah once all are set...  
}

// You can also check to see if a single property or different
multiple properties have been set, and do certain actions then...
if(propsSet.indexOf("ballType") != -1){
// do Blah if "ballType" has been set...
}
}

I try to avoid onEnterFrames if possible (unless I really need them,
for something like papervision scene rendering)..

Timers are not the best method, although they usually work, but I find
that the above approach is the best method.

- Taka

On Thu, Feb 19, 2009 at 10:17 AM, Gregory N  wrote:
> 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?
>
> On 2/19/09, Gregory N  wrote:
>> 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)
>>
>> On 2/19/09, Muzak  wrote:
>>> 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
>>>
>>
>>
>> --
>> --
>> Best regards,
>>  GregoryN
>> 
>> http://GOusable.com
>> Flash components development.
>> Usability services.
>>
>
>
> --
> --
> Best regards,
>  GregoryN
> =

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

2009-02-19 Thread Taka Kojima
As Weyert was getting at, just use default argument values, which
would only be applied if you didn't specify an argument...

i.e.

   public function Ball(which:String = "soccerball"){
   gotoAndStop(which);
   }

this way you can do:

var b:Ball = new Ball("basketball");
addChild(b);

and you can drag an instance to the stage (which would default going
to frame "soccerball"

but, seeing as it is a component, you probably want to have an
inspectable, these are properties that can be set through the
"Component Inspector"

If I were to write the class/component, I would probably do write it like:

package{

import flash.display.MovieClip;

public class Ball extends MovieClip{

private var _ballType:String = "";

[Inspectable(name="Ball Type", defaultValue = "soccerball",  
type = String)]

public function set ballType(_value:String):void{
_ballType= _value;
gotoAndStop(_ballType);
}
public function get ballType():String{return _ballType;}

public function Ball(which:String = "soccerball"){
ballType = which;
}
}
}

- Taka

On Thu, Feb 19, 2009 at 9:12 AM, Gregory N  wrote:
> 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)
>
> On 2/19/09, Muzak  wrote:
>> 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
>>
>
>
> --
> --
> Best regards,
>  GregoryN
> 
> http://GOusable.com
> Flash components development.
> Usability services.
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders

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

2009-02-10 Thread Taka Kojima
I usually don't use parseInt for this purpose I usually just cast it as a uint.

i.e.

uint(c);

would work as well.

glad you figured it out.

- Taka

On Tue, Feb 10, 2009 at 5:54 AM, ali drongo  wrote:
> Thanks everyone, Juan, you solved the final part of the puzzle and Muzak
> thanks for your utility class it's very useful.
> Cheers again!
> Ali
>
> On Tue, Feb 10, 2009 at 1:13 PM, Muzak  wrote:
>
>> 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
>>
> ___
> 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] Getting attributes out of a node with : in it

2009-02-09 Thread Taka Kojima
I just realized that the link I sent doesn't mention the namespace
operator, which is the main thing you need...

The following example uses the :: operator to identify XML properties
with specified namespaces:

var soap:Namespace = new Namespace("http://schemas.xmlsoap.org/wsdl/soap/";);
var w:Namespace = new Namespace("http://weather.example.org/forecast";);
var myXML:XML =
http://schemas.xmlsoap.org/wsdl/soap/";>
 
  http://weather.example.org/forecast";>
   Quito
   Ecuador
   2006-01-14
  
  
;

trace(myXML.soap::Body.w::forecast.w::city); // Quito


so in your case, try doing...

trace(myXML.yweather::conditi...@text);

should work.

- Taka

On Mon, Feb 9, 2009 at 12:20 PM, Taka Kojima  wrote:
> I take it this is from an rss feed?
>
> Look into the Namespace class...
>
> http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/Namespace.html
>
> Unfortunately, you didn't paste the entire XML doc so I can't guide you
> further.
>
> - Taka
>
> On Mon, Feb 9, 2009 at 10:36 AM, Eric E. Dolecki  wrote:
>>
>> For example I have a node like so:
>>
>> 
>>
>>
>> How can I get into that node to pull attributes out? The ":" in the node
>> name is screwing my up at the moment.
>>
>> Eric
>> ___
>> 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] Getting attributes out of a node with : in it

2009-02-09 Thread Taka Kojima
I take it this is from an rss feed?

Look into the Namespace class...

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/Namespace.html

Unfortunately, you didn't paste the entire XML doc so I can't guide you
further.

- Taka

On Mon, Feb 9, 2009 at 10:36 AM, Eric E. Dolecki  wrote:

> For example I have a node like so:
>
> 
>
>
> How can I get into that node to pull attributes out? The ":" in the node
> name is screwing my up at the moment.
>
> Eric
> ___
> 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] Either an incredibly easy or incredibly difficult problem

2009-02-09 Thread Taka Kojima
I'd probably just determine the points ahead of time and recreate it using
AS...

Most likely, that would be less time consuming. That's my answer if this is
a practical question, if it's theoretical and you just want to know if it
can be done, I'm sure it can, but I'm not totally sure which method to use
to achieve the desired result.

- Taka

On Mon, Feb 9, 2009 at 11:56 AM, Mark Winterhalder  wrote:

> On Mon, Feb 9, 2009 at 7:47 PM, Todd Kerpelman  wrote:
> > Hey, coders!
> >
> > I have a Sprite that consists of a polygon that I drew in Flash (using
> the
> > line tool) and saved into my Library.
> >
> > Using ActionScript, is there any way to easily find the points of said
> > polygon? It seems like I oughta be able to dig up those line coordinates
> out
> > of my Sprite.graphics object, but I can't seem to find a way of doing
> it...
>
> You'll end up reading the coordinates from inside the Flash IDE or by
> using a tool like Swfmill, but just for sports, and with the
> limitation that it needs to be convex, this is the easiest way I can
> think of:
>
> Rotate it slowly. Use getRect to find out how far it extends towards,
> say, the right, at a given rotation. When that distance decreases,
> it's a point, and you can calculate its coordinate via the distance
> and rotation. Repeat until you've made a full turn.
>
> If it's not convex, I guess you'd need to trace it...
>
> Mark
> ___
> 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


  1   2   >