Re: [Flashcoders] Problem understanding Class heirarchy issue

2009-09-01 Thread Steven Sacks

You're not calling super() in the ClassA constructor.


On Aug 31, 2009, at 11:12 PM, Sajid Saiyed wrote:


Ok, Here is a bit more information.

ClassA (works pefrectly fine):
---
package com.folder.subfolder
{
   import flash.display.*;
   import flash.events.*;
   import flash.filters.*;
   import flash.utils.Timer;
   import com.folder.subfolder.*;

   public class ClassA extends ClassC
{
   public var myMenu: ClassB;

   public function ClassA (){
addEventListener(ClassC.moveUP, someFunction);
   }
   public function someFunction(){
myMenu = new ClassB();
 myMenu.name = "mymenu";
 this.addChild(myMenu);
   }

   }
}

ClassB
---
package com.folder.subfolder
{
   import flash.display.*;
   import flash.events.*;
   import flash.filters.*;
   import flash.utils.Timer;
   import com.folder.subfolder.*;

   public class ClassB extends ClassC
{
   public function ClassB (){
// This is not getting called.
   }
   }
}


Does this explanation help a bit??
Am I looking at the right place for the problem or the problem could
be somewhere else?

Thanks
Sajid

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


Re: [Flashcoders] seeing is xml has children

2009-08-27 Thread Steven Sacks

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


var hasChildren:Boolean = xmlLabels.section.children().length() > 0;
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] empty XML Attributes..

2009-08-27 Thread Steven Sacks
Unfortunately, that doesn't work.  That returns something (an empty XMLList, I 
believe).


The best way to test for attribute existence and/or if it has a value is what I 
wrote.




Glen Pike wrote:
Thanks for the answers with the length() thing - I tried out a few of 
those and got working thing
You're suggesting to write more code to do the same thing. Why should 
anyone write more code to do the same thing?


With the above comment in mind - I was trying to do if(no...@attribute) 
which I thought would be the simplest most sensible way of doing - if 
something does not exist, why return an object / value?  I could test 
for undefined, but that did not seem to work, I will try again though...


Thanks.

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


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


Re: [Flashcoders] RE: Flash speech-to-text

2009-08-26 Thread Steven Sacks
Well, if you're got a working server solution, then all you have to do is send 
an mp3 file to the server, which that link I sent you should describe how to do.


Rock on with your bad self.
___
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 Steven Sacks

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


Re: [Flashcoders] empty XML Attributes..

2009-08-26 Thread Steven Sacks
hasOwnProperty does not tell you whether it has a length, though.  It only 
checks for existence.


And for some reason, it looks like you modified my code when quoting me:

>> if (node.hasOwnProperty("instance").length() > 0)

I didn't write that code, which would error since a Boolean doesn't have 
length().

I wrote this:

if (node.attribute("instance").length() > 0)

Which not only works, but is the recommended way of writing this code by Adobe 
themselves directly from the E4X documentation.


You're suggesting to write more code to do the same thing. Why should anyone 
write more code to do the same thing?

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


Re: [Flashcoders] empty XML Attributes..

2009-08-26 Thread Steven Sacks
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.attribute("instance").length() > 0)
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] spacing horizontal dynamic xml menu textfields

2009-08-26 Thread Steven Sacks

As I described on my forum post, you have to first put your items in an array.

var items:Array = [all, of, your, items];
var len:int= items.length;
var i:int;

Then, you do the following measurements:


// the right of the last item minus the left of the first item
var availableWidth:Number = items[len - 1].x + items[len -1].width - items[0].x;

// the total widths of all the items
var totalWidth:Number = 0;
i = len;
while (i--)
{
totalWidth += items[i].textWidth;
}

//Subtract the totalWidth from availableWidth to get the remainingWidth
var remainingWidth:Number = availableWidth - totalWidth;

// Divide remainingWidthby the number of items
var gapWidth:Number = remainingWidth / len;


// iterate through your array setting the x positions
// of the items based on the previous item's width and the gap.

var lastX:Number = 0;
for (i= 0; i < len; ++i)
{
items[i].x = lastX;
lastX = items[i].textWidth + gapWidth;
}

// That's all there is to it.

___
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 Steven Sacks

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


Re: [Flashcoders] How to add a DisplayObject into a container without using addChild() method.

2009-08-18 Thread Steven Sacks
The reason you're comfortable straddling the fence is because you don't 
experience the pain or discomfort associated with a picket sticking into your 
crotch.  Why would that be?  ;)


How do YOU code? Do you use implicit or explicit?

Dave Watts wrote:

I think you're missing the point. You're asking a pacifist which army
he should join. I really don't have a strong opinion either way.

___
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 Steven Sacks

Dave, come on. Take a stand on the issue. Stop straddling the fence.

Pick a side. Im or Ex?

I'm not about writing cryptic PERL-like statements, but writing != null is a 
waste of time.  It's obviously a null comparison (by nature of it being an 
instance).  Calling it out as such is redundant.


It also lends itself to very readable code with inline ORs.

var value:String = foo || bar;

If foo is null, value = bar.  Great for default values such as with XML.

var value:String = x...@foo || "";

Very readable and so much better than

var value:String = "";
if (x...@foo != undefined) value = x...@foo;
___
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 Steven Sacks

That was supposed to be a winky, not a frowny.

Steven Sacks wrote:

I didn't see a reponse from Ash.  Yet another email lost to the ether.  :(


Dave Watts wrote:

And as much as I like Ash, I'm not sure I want to take coding advice
from the guy who couldn't remember "klaatu barada nikto" - maybe he
was too enamored of shortcuts?

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] How to add a DisplayObject into a container without using addChild() method.

2009-08-18 Thread Steven Sacks

I didn't see a reponse from Ash.  Yet another email lost to the ether.  :(


Dave Watts wrote:

And as much as I like Ash, I'm not sure I want to take coding advice
from the guy who couldn't remember "klaatu barada nikto" - maybe he
was too enamored of shortcuts?

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

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


Re: [Flashcoders] mac vs pc

2009-08-17 Thread Steven Sacks
The act of writing Actionscript in FlashDevelop is, IMO, better.  FD's code 
completion and code gen is easier and faster.  Because code completion and code 
gen is the majority of what I do from moment to moment as I'm writing, it's the 
better tool.


Refactoring and debugging are not what I spend the majority of my time doing.  I 
have Flex Builder.  I use it sometimes, but not always, and generally I use it 
with Build Automatically turned on while I code in FD on the same project and it 
will spot compile-time errors on the fly.


FDT is a great (albeit expensive) tool, but for day to day coding, I prefer 
FlashDevelop because it helps me write code faster.  It might not help me debug 
faster, but I spend a lot less time doing that than actually writing code, which 
is where FlashDevelop shines.


I'm confused by all these comments about the strength of the refactoring tool 
being a deciding factor.  Do you really move stuff around packages that often? 
Do you really rename entire classes that often?  I find that thinking ahead 
solves that problem, and when it comes up, Find and Replace in files does a 
great job, even if it's a few Find and Replaces instead of just one Refactor 
command.


Believe me, I (and many others) have asked the FD guys for this feature, and 
it's something they're working on adding.  However, it's not something I use 
often enough to outweigh the benefits FD provides when actually writing code.

___
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-17 Thread Steven Sacks

Here's the best way to write that. No try catch required.

if (myDO && myDO.parent) myDO.parent.removeChild(myDO);


Keith H wrote:


Steven,

Maybe its just me but...
Just doing a Boolean check on DisplayObjects always put my scripts in 
high risk of runtime errors.

Especially in the case of "cleanup" operations.
Sometimes I might have a function that attempts removing a DisplayObject 
that has not been "added" to the stage or has already been removed.


So I check if the "stage" property is null for almost all cases now.

var myDO:Sprite=new Sprite();
try {
   //if (myDO) { //Creates runtime error
   if (myDO && myDO.stage != null) {
   myDO.parent.removeChild(myDO);
   }   } catch (e:Error) {
   trace(e.message);
}

-- Keith H --
www.keith-hair.net

___
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-17 Thread Steven Sacks

I highly suggest reading "Practices of an Agile Developer"
http://www.pragprog.com/titles/pad/practices-of-an-agile-developer

Use KISS. Stay DRY. Code less. Code smart (code S-Mart).

Use smart shortcuts when they're available to you.  Implicit boolean coercion is 
one such shortcut, among many others.


We need to get things done.  We don't have the luxury that academia has to argue 
about theory for months and years.


:)
___
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-17 Thread Steven Sacks

James Gosling got his Doctorate in CS in 1983.

Programming has changed quite a bit since then.

new > old

;)


Dave Watts wrote:

And you are eating code, through your eyes and brain.  :)


... and I must therefore excrete code from my fingertips. And the
usefulness of this metaphor reaches a disgusting end.

All that said, my point was simply that opinions differ on whether
implicit Boolean conversion is good or bad, no matter how many AS3
style guide links you bust out. You say they're good, James Gosling
says otherwise, I don't know who to believe.

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] How to add a DisplayObject into a container without using addChild() method.

2009-08-17 Thread Steven Sacks

It's called artistic license.  ;)

And you are eating code, through your eyes and brain.  :)



Dave Watts wrote:

Code bloat is one of the seven deadly sins (gluttony).


This is why we all name our variables things like x, y, etc instead of
giving them recognizable names, right?

And gluttony, really? I'm not going to EAT my code. Luxuria is a
better fit, even though we actually call it "lust" nowadays.

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] How to add a DisplayObject into a container without using addChild() method.

2009-08-17 Thread Steven Sacks

Dave Watts wrote:
> Lots of people hate implicit Boolean conversion, and see it as a sin
> against God and nature. I'm not one of those people, but I think it's
> a mistake to say that implicit Boolean conversion is superior and
> everyone should use it.

Code bloat is one of the seven deadly sins (gluttony).

Besides, something has to be superior. It's an if statement, after all.
___
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-17 Thread Steven Sacks

if (Boolean)

Everything inside an if statement is automatically coerced into a Boolean.

Either it is or it isn't.

It's not more clear to write != null because an if statement cannot possibly be 
anything other than true or false. In this case, null or not null. Writing it 
out is redundant (and more code).


Recommended reading:
http://opensource.adobe.com/wiki/display/flexsdk/Coding+Conventions

Specific to this case:
http://opensource.adobe.com/wiki/display/flexsdk/Coding+Conventions#CodingConventions-Expressions
___
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-17 Thread Steven Sacks
I don't understand why you would not want to write a single line of code in the 
class where it would provide the most clarity, and instead write MORE code in 
another class obscuring the behavior that is going on.  In other words, you're 
writing more code to write the same code.  You're going to write addChild either 
way, why make it more complicated than it needs to be?


Always follow the KISS principle.


BTW, Ekameleon, you should use

if (target)

Instead of

if (target != null)



ACE Flash wrote:

ekameleon, you are the man! so sweet.

Thanks

On Mon, Aug 17, 2009 at 1:54 PM, ekameleon  wrote:


Hello :)
Use an argument in the constructor of you class to passed-in the parent
reference of your display

public function MyDisplay( target:DisplayObjectContainer = null )
{
   if ( target != null )
   {
target.addChild( this ) ;
   }
}

PS : your code isn't valid in the constructor of a DisplayObject the
"stage"
and "parent" properties are "null" ! Only in the main class of your
application this two attributes are not null.

EKA+ :)

2009/8/17 ACE Flash 


Hi guys,

I am curious about if am able to add the DisplayObject into a container
without using addChild() method, this class is very simple...



  1. package
  2. {
  3. import flash.display.Sprite;
  4. import flash.events.Event;
  5.
  6. public class MyClass extends Sprite
  7. {
  8.
  9. public function MyClass ()
  10. {
  11. //addEventListener( Event.ADDED_TO_STAGE , addedHandler );
  12. parent.addChild(this);
  13. }
  14. /*
  15. private function addedHandler( e:Event ):void
  16. {
  17. removeEventListener( Event.ADDED_TO_STAGE , addedHandler );
  18.
  19. parent.addChild(this); // how could I retrieve the instance name of
  this"?
  20. }
  21. */
  22. }
  23. }



I'd like to do something like


var do:MyClass = new MyClass();
//addChild(do) // added it into displayobject without using this method
here


Is that possible? any suggestions are welcome  :)

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


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


___
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] Slow emails

2009-08-16 Thread Steven Sacks

As I understand it, the previous ones were lost forever, unfortunately.


Alan wrote:
I think the current Mailman configuration works well, although it would 
be nice if the web archives worked.  There's so much helpful information 
coming through this list, but they end in late 2007.


Alan



If the consensus is that we should move over there, I'm willing to go
ahead and do that. But I'm a little reluctant to migrate the
Flashcoders user list directly over there on my own volition, because
of the negative feedback I got last time I had problems with the user
list.



___
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] Slow emails

2009-08-16 Thread Steven Sacks

Dave,

As an example of the irregular nature of the current list server, I did not 
receive your response.  I saw Latcho's response to your response, which 
thankfully quoted your response, otherwise I would have missed it.  I'm not sure 
how many emails I've missed and *not* known about.


Thanks for setting up the google group.  It might be possible to export the 
entire list of Flashcoders members as a comma delimited text file, which you 
could then copy and paste into the Google Group invite (as the owner of said 
group) and then everyone on the list would be notified of the new list.


Cheers,
Steven



Latcho wrote:

No prob man. Thanks for maintaining this.
Flashcoders is fine where it is.
If we have a problem next time we can continue chatting on Tiger list :)
We'll be back anyway ;)
Latcho


Dave Watts wrote:

So the question is: Why does Dave use this slow hosting company
to run the Flashcoders mailing list when there are better and cheaper 
(free)

alternatives available?



Good question!

But first, I should correct a minor misperception. It's not a matter
of a slow hosting company, or a slow server - the current server is
fast enough to handle the load it gets, and there's plenty of
bandwidth at the ISP. I subscribe to groups on both Google and Yahoo,
and generally see my posts just as quickly from chattyfig as with
those groups. Obviously, your mileage may vary, but there you go.

That said, if it were entirely up to me, I would have switched to
Google Groups. I'm a big fan of Google services in general - Fig Leaf
is a Google Enterprise partner, we use Google Apps for email,
calendaring and information sharing, etc, etc.

However, we run a number of lists, not just Flashcoders. There are
about a dozen different lists. Some of those lists have some actual
business value for us, as a channel for our expertise and for
advertising our services. Flashcoders really doesn't at this point, if
it ever really did at all. When these lists were set up long ago, they
were set up using mailman. Mailman stores user lists and other data in
a non-text format: Python qpickle files. When the Flashcoders list
broke, I had absolutely no familiarity with this, and so had no way to
export users from Mailman to Google Groups. I did, on the other hand,
have a shiny new server that wasn't doing anything else, so the path
of least resistance was to set up Mailman and just move everything
over.

Out of all those lists, Flashcoders was the only one with which I had
any problems. Because Flashcoders' files were corrupted, and I didn't
know Python, I had to manually extract information from the qpickle
files. The other lists ran fine the whole time, and I could migrate
them without any trouble. But I sure did run into trouble migrating
Flashcoders for a variety of reasons, and got a bunch of flak from
subscribers who didn't know how to unsubscribe, etc.

So, in conclusion, if I woke up tomorrow and this was on Google
Groups, I'd be perfectly happy. But that would require current
subscribers to subscribe to that on their own. I just went ahead and
created a group:

http://groups.google.com/group/flashcoders-group

If the consensus is that we should move over there, I'm willing to go
ahead and do that. But I'm a little reluctant to migrate the
Flashcoders user list directly over there on my own volition, because
of the negative feedback I got last time I had problems with the user
list.

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


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


Re: [Flashcoders] Slow emails

2009-08-14 Thread Steven Sacks

Kerry,

My email was a matter of fact one, nothing more.  It had nothing to do with the 
quality of the posts, members or owner.


Flash Tiger emails show up very quickly because they're on Yahoo servers. 
Despite their recent financial troubles, Yahoo has a ton of servers on very fat 
pipes.


By contrast, Flashcoders is hosted by a smaller company than Yahoo.  For some 
reason, this host delays emails by minutes, and sometimes much longer.  Moving 
to a faster host is probably either too expensive or time consuming (backing up 
the archives, etc.).  It's not like the delay is that bad, but it does exist.


I sometimes wonder why Flashcoders isn't hosted on Google Groups like AIR-TIGHT 
or Yahoo Groups like Flash Tiger.  As you well know, Flash Tiger was created 
because Flashcoders was down for over a month.  Years of the Flashcoders 
archives were lost to the ether because of a server failure.


Flashcoders was created during a time when Google/Yahoo groups did not exist. 
No slight to Dave, but maintaining your own public email list is a 1.0 
mentality.  There are great services like Yahoo and Google groups that offer 
more features than a self-hosted solution without the cost or headaches.


When was the last time Google groups went down?  Google groups has a team of 
people available around the clock making sure it's up, so if it goes down, it's 
not down for long.  With Flashcoders, there's just Dave maintaining it.  When it 
goes down, you have to hope he's awake and not busy.


So the question is: Why does Dave use this slow hosting company to run the 
Flashcoders mailing list when there are better and cheaper (free) alternatives 
available?


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


Re: [Flashcoders] FlexBuilder 3 auto-complete vs. FlashDevelop

2009-08-14 Thread Steven Sacks
Unfortunately, yes, I get runtime errors sometimes when screens are split and 
you close some tabs.  You can choose to ignore the errors and FlashDevelop will 
keep on trucking.  You don't have to quit.



Joel Stransky wrote:

Hey Steven, does FD crash on you when you have your view split and choose
File->close all?

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


Re: [Flashcoders] FlexBuilder 3 auto-complete vs. FlashDevelop

2009-08-13 Thread Steven Sacks
In FlexBuilder, they don't start appearing as auto-completion hints as you type. 
You have to hit CTRL+SPACE. This is not a "mere" difference. You have to stop 
writing code to get auto-completion. Even worse, it's not "live" which means it 
breaks your natural flow.


In FlashDevelop, you can hit space, return, period, open parentheses, open 
bracket, or any non-alphanumeric character and it will auto-complete.  In 
FlexBuilder (and AFAIK, FDT) only return works.


Here's a simple example:

var loader:Loader;

In FlashDevelop, you type these exact characters:

lo.l(

And it turns into this:

loader.load(


In Flex Builder, you have to type this:

lo CTRL+SPACE RETURN . l RETURN


That's 3 mental "breaks".  FlashDevelop's auto-completion is a natural flow and 
doesn't interrupt your typing, FlexBuilder's does three times.


Let's quickly look at Flex Builder's example again in detail so I can really 
illustrate the mental break it causes.


lo CTRL+SPACE RETURN . l RETURN

First, you have to hit two keys to get the hint, and then one more key to accept 
the hint.  Then, you type the period and then have to hit return again to accept 
the load function hint.  That last return causes oad( to appear.


The important part of that completion is the open parentheses.  You are expected 
to type RETURN to type ( and that is a mental break.  It's far more natural to 
type open parentheses because that's what your mind knows goes after a method 
name.  Sure, SHIFT+9 is not as "easy" to type as ENTER, but that's hardly the 
point.  This is about your mental flow as you type.  One makes you "think" 
(three times), the other doesn't because it just makes sense.


FlashDevelop's auto-completion allows you to access arrays and such easily, too.

var array:Array = [];

FlashDevelop:

ar[

Ends up with

array[


FlexBuilder you have to type:

ar CTRL+SPACE ENTER [

Lame.

On top of that, if you make a typo in FlexBuilder or FDT, the hints go away.  If 
you press CTRL+SPACE and there's a typo you get no hints.  In FlashDevelop, 
typos are forgiven and code hints still show up, and again, "live" as you type.


When it comes to auto-completion, the undisputed winner is FlashDevelop.  FDT is 
in second place, and FlexBuilder a distant third.

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


Re: [Flashcoders] FlexBuilder 3 auto-complete vs. FlashDevelop

2009-08-13 Thread Steven Sacks
It certainly does. It's simply using the mxml compiler to find those errors. The 
FD developers have stated their intent to include it one day, but have stated 
it's a lot of work.  They currently have syntax checking.  Keep in mind that 
FlashDevelop is two guys working in their spare time for free.



jared stanley wrote:

FDT does the auto-error check, which is so sweet - i read that FD
doesn't have the ability to get that info, even with a plugin...

I have built projects on all three, and if I'm on pc I like FD with
the find/replace expanded extension.

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


Re: [Flashcoders] FlexBuilder 3 auto-complete vs. FlashDevelop

2009-08-13 Thread Steven Sacks
FlexBuilder absolutely does NOT do auto-completion of class, instance and local 
vars (FD also does function names, etc.).  I've never seen FDT do it, either, 
but that link obviously makes it clear that it is possible (though completely 
undocumented, not to mention that field doesn't look like it will accept 28 
characters).  It also says AS2, but does that work for AS3?  Why on earth isn't 
this the default behavior?


FDT costs hundreds of dollars, FlashDevelop is free. If you're on Mac, I guess 
it's the best choice available.


Also, FDT is 100% project based. You can't just drag and drop an .as file on to 
it like you can with FlashDevelop (unless you already have one open).  Plus, you 
don't get ANY auto-completion if the file isn't part of your project.


Does FDT have a clone-file feature?
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] FlexBuilder 3 auto-complete vs. FlashDevelop

2009-08-13 Thread Steven Sacks
FlashDevelop auto-completes class, instance and local vars, as well as native 
key words like public, private, class, interface, implements, function, static, 
const, etc.  FDT and FB do not.


Here's what toggle line does


hello();
world();

CTRL+T on world line

world();
hello();

While this might seem minor, it's actually VERY handy.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Slow emails

2009-08-13 Thread Steven Sacks
I have slow email issues with Flashcoders, as well.  There's a noticable delay 
between when I post and when it shows up.  Sometimes I get no emails for awhile, 
and then a slew of them come in (like a hose that's been crimped and then released).


FlashTiger emails show up very quickly, but they're a Yahoo group, so the host 
is very fast.  Compared to Yahoo, atlas.pipex.net is rinky-dink.

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


Re: [Flashcoders] mac vs pc

2009-08-13 Thread Steven Sacks
FlashDevelop does do find and replace in files.  FlexBuilder's "rename" function 
is very slow sometimes.  FlashDevelop's Find and Replace In Files is nearly 
instant.  Considering how infrequently one uses "rename" in FlexBuilder, it 
doesn't seem to offset the slowness of day to day coding with it compared to 
FlashDevelop.


To fuel the fire a bit more, IMNSHO, Windows has MUCH better carat control than 
Mac.  This makes writing code (and other documents) a lot easier and faster on 
Windows.  As much as I love OSX (and I really do), Mac's inferior carat control 
is one of the things I find very lacking about it.


The auto-complete mishaps with FD occurred in some (not all) of the beta 
releases, but now that it's a full release version, there are no longer any 
problems.

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


Re: [Flashcoders] FlexBuilder 3 auto-complete vs. FlashDevelop

2009-08-13 Thread Steven Sacks
Only FlashDevelop auto-completes in-scope member names and key words.  Only 
FlashDevelop has smart auto-completion that forgives typos.  AFAIK, only 
FlashDevelop has toggle line (CTRL+T) functionality (which I use all the time), 
and the *extremely* useful clone file (CTRL+SHIFT+N) functionality.

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


Re: [Flashcoders] mac vs pc

2009-08-12 Thread Steven Sacks
I'm confused why you would need to look at more than one project at a time, and 
you can switch projects very quickly in FD by using Recent Projects.


It's well established the debugger is limited to tracing, which is generally 
good enough for most of the time.


I don't know what you mean about better syntax and variable scope across 
documents. I find the variable scope feature of FlashDevelop to be fantastic. 
The F4 key is great. If you mean something else, I'm definitely interested.


What plug-ins are you talking about specifically that Eclipse has that help with 
coding Actionscript?


I agree the documentation is lacking. I've discovered new features on accident.

I keep hearing about the refactoring feature, but how often are you refactoring 
and how does Find and Replace in Files (CTRL+I) not take care of it?


In FB or FDT, if you make a typo, you lose it and you have to start over.  This 
goes for properties and constants, etc.  I don't know about you, but while I'm a 
great typist, I'm not perfect, and FlashDevelop is forgiving and still knows 
what you want, even if you typo or hit backspace to make a correction, where if 
you hit the wrong key or backspace in FB or FDT, you lose everything.  This is 
especially a pain with long names.


The getter/setter code gen for vars and the event code gen are incredible time 
savers.  The default shortcut isn't very good, but you can change it (I use ALT+2).


FlexBuilder and FDT offer live code compiling, which FlashDevelop does not. 
FDT's lexical parsing is superior to FlexBuilder, as well.  However, I find that 
those features are not worth the speed tradeoff, and I can just compile anytime 
to see any runtime errors. FlashDevelop's syntax checking is generally good enough.


Every developer I know that uses FlashDevelop for about a month can't live 
without it. Every developer that never has or hasn't learned the time-saving 
features it has (lack of documentation definitely doesn't help) doesn't really 
understand how much faster it is to develop in and if you don't have anything to 
compare it to, FlexBuilder and FDT are much better alternatives to coding on the 
timeline (ugh).

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


Re: [Flashcoders] mac vs pc

2009-08-12 Thread Steven Sacks

Oh yeah, and Flex Builder is $500 whereas FlashDevelop is free.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] mac vs pc

2009-08-12 Thread Steven Sacks

I didn't say people who used it were retarded, I said the program was.

The bottom line is, you can use Flex Builder to do your debugging if you need 
it, but for coding, which is what you spend the majority of your time doing, all 
the Eclipse-based Actionscript editors suck ass compared to FlashDevelop.


If you make a typo in FB or FDT, you're screwed. You have to go all the way back 
to the period.  In FlashDevelop, you're fine.  It still offers you the 
auto-completion (is this what you meant?).  FlashDevelop's class importing 
doesn't require you to type the entire package first.  You just type the class 
name and the entire package appears no matter where the class is.


And to the person who says that Flex Builder organizes your imports for you and 
FlashDevelop doesn't, that takes a few seconds ONE TIME for you to do in 
FlashDevelop (using the awesome CTRL+T shortcut that FlashDevelop has and 
FlexBuilder doesn't), whereas all the shortcomings of Flex Builder's 
auto-completion cost you a few seconds over and over constantly, plus added 
frustration.  It's not even open to debate which one wins when it comes to 
time-savings and saved frustration.  What you're talking about is an aesthetic, 
not a function, and it's easy to do in FlashDevelop.  There is no comparable 
solution in Flex Builder for auto-completion and code-gen.


The code gen in FlashDevelop is superior to Flex Builder. The auto-completion is 
superior.  The class importing is superior.  The workflow is superior.  You can 
open any .as file without it having to be part of your project.  If you really 
want the debugger, then use it for that.  I keep Flex Builder open while I code 
in FlashDevelop for that specific reason.


Code with the coding tool, compile with the debugging tool.  Flex Builder sucks 
at coding, and is great at debugging.

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


Re: [Flashcoders] mac vs pc

2009-08-11 Thread Steven Sacks

My home computer is a Windows XP box.

My last full-time job was a Mac-only shop.  So, I used Mac every day, 5 days a 
week, for 10 months.


Within a few weeks, I realized I couldn't live without FlashDevelop. I installed 
Parallels 3 with Windows XP and figured out how to use FlashDevelop in my 
workflow there.


I *love* Expose and Spaces.  However, they are easier to live without than 
FlashDevelop.  FDT and FlexBuilder both suck ass as Actionscript editors 
compared to FlashDevelop.


I cannot live without FlashDevelop.  Period.  Anyone who has spent any serious 
time with it knows that it isn't an option.  The day they get it working on the 
Mac is the day Flex Builder (ahem, Flash Builder) sales see a significant drop. 
 The only reason so many people buy Flex Builder for Mac is because 
FlashDevelop is currently PC-only.


Actionscript coding in Eclipse is retarded.  It's slow, clunky and basically, 
sucks.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Flex interferes with SVN

2009-06-26 Thread Steven Sacks

http://jessewarden.com/2008/05/two-directory-source-control-workflow.html


On Jun 26, 2009, at 3:00 PM, Mario Gonzalez wrote:

If I have a project that is under subversion control, then I decide  
to make a flex project with the folder (order of these two  
operations can be reversed with same results) everything gets  
screwed up.
I can't add/commit (* is already under version control) my files  
because flexbuilder already has it's own internal 'subversion' type  
system.


If you try to commit you get this error
Over all its a big annoying mess,

What do you guys do in this situation?


Mario Gonzalez
http://onedayitwillmake.com
Senior Developer | WDDG.com



__ Information from ESET NOD32 Antivirus, version of virus  
signature database 4193 (20090626) __


The message was checked by ESET NOD32 Antivirus.

http://www.eset.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 MouseWheel Listener Problem

2009-06-26 Thread Steven Sacks

http://www.libspark.org/wiki/SWFWheel/en

On Jun 26, 2009, at 1:50 AM, Dav wrote:


Hi Guys,

I'm having a problem with attaching the mouse wheel listener to the  
stage in

AS3.

For some strange reason, when flash is focused and I scroll my mouse  
wheel,

the entire browser scrolls along with flash itself!

Any ideas how to prevent this?

I believe Google is not my friend on this one!

Cheers,
Dav

___
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: SWAddress logical workflow

2009-06-16 Thread Steven Sacks
This is exactly how Gaia works.  goto() calls setValue on SWFAddress  
and the response is dispatched to the framework to handle the  
navigation.  Interrupts are handled in both loading and transitions.   
It's open source, so you're welcome to examine how it's done in Gaia.



On Jun 16, 2009, at 1:08 PM, Glen Pike wrote:

I see what you mean by setting a future date on the FWA site - I  
managed to screw up the history completely (FF2 WinXP) so got stuck  
forever on that date a bit like Groundhog Day :)
I think the only way to deal with fast browsing is to allow your  
loading / transition process to be interrupted if you keep getting  
changes from SWFAddress.  Personally, I have not really thought  
about this in my stuff before, but the way you said you were  
approaching the SWFAddress bit seemed sensible to me - going a round- 
about way by setting the URL when you navigate in Flash then  
responding to the change via SWFAddress.  This seems much "safer"  
because everything goes through a single route.


There is a nice example of doing the dynamic thing with PHP in the  
SWFAddress examples.  You can even tweak the whole site with Apache  
& mod_rewrite to get "pretty" URL's - this may / may not work with  
Zend AMF quite nicely so download and examine this example: http://www.asual.com/swfaddress/samples/seo/ 
 which seems to be the smoothest one.


If you are worried about fast clicking, have a look to see how an  
HTML site behaves with this - I guess you get half-assed page  
loading, etc. But people expect to wait a bit for something to load  
if they go back & forth, you just have to be prepared to "interrupt"  
what you are doing (I should probably take my own advice here and  
make sure my SWFAddress site behaves nicely)


Hope this helps and if you come up with any interesting stuff, let  
us know!


Glen


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


Re: [Flashcoders] array.indexOf problem

2009-06-16 Thread Steven Sacks

Your sample doesn't show how you build the Array.

So the answer to your incomplete question is nothing different than  
what Flash is telling you.


The reason it returns -1 is because indexOf couldn't find a STRICT  
EQUALITY match for e.target.name in your array.


If you posted how you built buttonsArray, you'd probably solve your  
own problem by looking at the code you wrote more closely.



On Jun 16, 2009, at 12:48 PM, Isaac Alves wrote:


Hi fellows,
Cannot solve this problem:

   function buttonClicked(e:Event):void {
trace (buttonsArray.indexOf(e.target.name));

It always  traces "-1". This code should trace the index of the Array
element right? for ex: 0, 1, 2 or 3.

If i do this, it will trace the correct name of the element.

   function buttonClicked(e:Event):void {
trace (e.target.name);

If I do this, it will trace the name of the second element:

   function buttonClicked(e:Event):void {
trace (buttonsArray[1].name);

Why indexOf doesn´t work properly?

Thanks a lot!
___
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 find and delete nodes

2009-06-09 Thread Steven Sacks
Once you really dig into E4X and realize the crazy stuff you can do,  
it's amazing.


I do some pretty crazy E4X parsing, filtering and validation with  
Gaia.  Here are some examples:


// get all nodes named page or asset in the entire XML
var nodes:XMLList = xml.descendants().(name() == "page" || name() ==  
"asset");


// from those nodes, find any that don't have both id and src attributes
var invalidNodes:XMLList = nodes.(!attribute("id").length() || ! 
attribute("src").length());


//  get all nodes where id is not alphanumeric or begins with a number
invalidNodes = nodes.(!(/^[a-z_][a-z0-9_]*$/i.test(@id)));

// this one is complex but basically it isolates nodes that do not  
have a valid

// class package path in a package attribute
var packageNodes:XMLList = xml.descendants(). 
(attribute("package").length() > 0);
invalidNodes = packageNodes.(!(/^[a-z][\w\.]*\w+$/ 
i.test(attribute("package";



As you can see, combining E4X and RegEx you can do some CRAZY stuff.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] XML find and delete nodes

2009-06-09 Thread Steven Sacks
Actually, you don't need that newXML var.  Sorry. I left that in  
during debugging.


Just setChildren the original xml, as I did.  If you want to make a  
copy without destroying the original, then setChildren() the newXML  
var instead.

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


Re: [Flashcoders] XML find and delete nodes

2009-06-09 Thread Steven Sacks
Filter the XML using E4X and then make a new XML from that filtered  
result.


var xml:XML = 








  





;
//
var list:XMLList = xml..module.(children().length() == 0);
var newXML:XML = ;
xml.setChildren(list);
trace(xml);
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Dynamic fonts and Tweens

2009-06-07 Thread Steven Sacks

Did you choose the characters you wanted to embed on the TextField?


John R. Sweeney Jr wrote:

After I attach the mc, I position both the _x and _y with no problem. The
_alpha does not function. I¹m now trying it in just a simple, new moving and
the alpha works if I attach the mc, but if I change the text with AS, then
it does not work.

John


on 6/5/09 9:47 AM, Jordan L. Chilcott at
jchilc...@interactivityunlimited.com wrote:


Did you set your embed properties (either in the property control panel
or with AS)?

jord


___
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] OT: The Vendor Client relationship In real world situations

2009-05-28 Thread Steven Sacks

http://www.youtube.com/watch?v=R2a8TRSgzZY

This is a work of genius.


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


Re: [Flashcoders] How do I flow text from an XML/XHTML file into two columns?

2009-05-26 Thread Steven Sacks

Could you show some sample of the XHTML you are reading in?

Specifically, what does body.p trace out?


On May 26, 2009, at 4:00 PM, Jonathan Wing wrote:

Using Gaia, I am trying to load content within flash from an XHTML  
file,
and have the text flow from a  into two columns. This is what I  
have

so far (AS3):



In the .fla file, I have two columns set as dynamic text, with the
instance names column1 and column2, respectively.



In the corresponding .as file, here is my code, including only the
relevant portions:



package pages
{
   import flash.display.*;
   import flash.events.*;
   import flash.text.*;
   import flash.external.*;
   import flash.xml.*;

   public class AboutPage extends AbstractPage
   {

  public var column1:TextField;
  public var column2:TextField;

  public function AboutPage()
  {
  super();
  alpha = 0;
  }
  override public function transitionIn():void
  {
  super.transitionIn();

  var value:XML = XMLList(copy.innerHTML)[0];
  var body:XML = value.div.(@id == "body")[0];
  var i:int = 1;

  column1.htmlText = body.p;
  addChild(column1);
  if (body.length() > 13) {
  column2.htmlText = column1.htmlText;

  for(i=0; i  column2.scrollV =  
column1.bottomScrollV +

1;
  addChild(column2);
  }

  TweenLite.to(this, 0.1, {alpha:1,
onComplete:transitionInComplete});
  }



So far, the text is indeed loading fine into column1, but then that's
it. The remainder of the content disappears, and does not load into
column2. I took some of Steven's suggestions and looked around Google,
but I still cannot get it to work. Does anyone else have any advice?





Thanks,

Jonathan Wing
Graphic Designer
Cram Crew, Inc.
mobile: (713) 298-2738
office: (713) 464-CRAM (2726)
email: jw...@cramcrew.com 
www.cramcrew.com 


"One Student At A Time"






The information transmitted is intended only for the person or  
entity to which it is addressed and may contain proprietary,  
business-confidential and/or privileged material. If you are not the  
intended recipient of this message you are hereby notified that any  
use, review, retransmission, dissemination, distribution,  
reproduction or any action taken in reliance upon this message is  
prohibited. If you received this in error, please contact the sender  
and delete the material from any computer. Any views expressed in  
this message are those of the individual sender and may not  
necessarily reflect the views of the company.



___
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] calling an "event" function with a parameter that is a number

2009-05-23 Thread Steven Sacks

The latter is cleaner and better, IMO.

Write a function that your event handler calls.  Then, you can call it from 
elsewhere and from your button click handler.


function onThumbClick(event:MouseEvent):void
{
loadImage(event.target.name);
}
function loadImage(num:int):void
{
   // loadImage(num);
}

Juan Pablo Califano wrote:

You have a couple of options:

You could add an optional parameter to the function that handles the click,
like this:

function clickThumb(e:MouseEvent,index:int = 0):void{

}

Setting a default value for the index parameter allows the function to be
called without passing it. That's what will happen when a thumb is clicked.

When you want to call the function directly, you'd do:

clickThumb(null,image_num + 1);

In clickThumb, check whether the event object is null or not. If it's not,
do what you're currently doing. If it's null, use the index parameter as the
index into my_images.


Another thing you could do is a bit of refactoring.

Have the click handler only resolve the index and calling another function
to actually load the image.

function clickThumb(e:MouseEvent):void {
 loadImage(e.target.name);
}

function loadImage(index:int):void {
if (my_full_images[index] == undefined){
   var full_url = my_images[inde...@full;
   ... etc ...
}

Then, from your other button's handler, call loadImage(image_num + 1);


Cheers
Juan Pablo Califano

2009/5/23 Isaac Alves 


Hello!
In my code there's a function that shows an image on the screen (or load
the
image and show a progress bar) that is called by clicking on a thumbnail,
and uses a parameter [e.target.name] refering to the property "name" of
the
thumbnail clicked, which is an integer. The thumbnails are placed inside
the
cointaner_mc MovieClip.

container_mc.addEventListener(MouseEvent.CLICK, clickThumb);

function clickThumb(e:MouseEvent):void{
if (my_full_images[e.target.name] == undefined){
var full_url = my_images[e.target.nam...@full;

etc...

but I want to call this function by clicking on a button, which would need
to pass another type of parameter, in this case, a variable which refers to
the number of the image displayed on the screen plus one.

I tried this:

clickThumb(image_num + 1)

But it doesn't work, I get the following error:

1067: Implicit coercion of a value of type Number to an unrelated type
flash.events:MouseEvent.

How could I call the function clickThumb and make it use "image_num + 1"
instead of "e.target.name" ?

Could I dispatch the event (MouseEvent.CLICK, clickThumb), passing this
value  "image_num + 1" ?

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


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


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


Re: [Flashcoders] Problem with footer fixed to bottom of page

2009-05-21 Thread Steven Sacks
Without posting the errors, I can't tell for sure, but it's possible  
you didn't declare


pubilc var footer_bar:MovieClip

at the top of your class?

Or, perhaps it's null?


On May 21, 2009, at 12:41 PM, Jonathan Wing wrote:


This is probably a silly question, but I've searched google and can't
seem to find the right answer, which is strange as this is seems to  
be a

common thing on pages.



Basically, I have a footer that is fixed to the bottom of a page and  
for

the width of a page, so that no matter what size a user sets a window
for, it will always fix to the bottom. This is what I have so far  
(using

AS3):



In my .fla, I have a long gray bar with the instance name "footer".

Then, over in my .as file, I have the following:



import flash.display.*;



footer.y = stage.stageHeight - footer.height;

stage.addEventListener(Event.RESIZE, resizeHandler);



public function resizeHandler(e:Event):void {

footer.y = stage.stageHeight - footer.height;

footer.width = stage.stageWidth;

}



All of this works without a hitch. However, my problem arises when I
want to add text. If I add text in its own mc, then it won't adjust  
with

the page. If I add text inside the footer mc, it will stretch with the
width of the page when I resize. So then I thought maybe I could make
them two mc's embedded in one main mc, and only define the width for  
the

bar. That is, something like:



footer.y = stage.stageHeight - footer.height;

footer_bar.width = stage.stageWidth;



With "footer" as the main mc, and "footer_bar" as the long gray bar
embedded inside.



However, this results in a mess of errors.



Any ideas? This seems so common, I'm surprised I can't find anything  
via

Google.



Thanks,

Jonathan Wing
Graphic Designer
Cram Crew, Inc.
mobile: (713) 298-2738
office: (713) 464-CRAM (2726)
email: jw...@cramcrew.com 
www.cramcrew.com 


"One Student At A Time"






The information transmitted is intended only for the person or  
entity to which it is addressed and may contain proprietary,  
business-confidential and/or privileged material. If you are not the  
intended recipient of this message you are hereby notified that any  
use, review, retransmission, dissemination, distribution,  
reproduction or any action taken in reliance upon this message is  
prohibited. If you received this in error, please contact the sender  
and delete the material from any computer. Any views expressed in  
this message are those of the individual sender and may not  
necessarily reflect the views of the company.



___
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] Parsing HTML tags within flash from an XHTML file?

2009-05-21 Thread Steven Sacks
Do you mean you want to have links in your  tags that call  
Gaia.api.goto()?


You can do that, but obviously, those links wouldn't work in the XHTML.

After thinking about it a bit, I think what might work is this

Go to contact page

With that being the link to the SEO XHTML page that is generated for  
that page.


In your parsing code, you would change the href to call an  
actionscript method that would take page.html and convert it to


var href:String = a...@href;
href = href.substr(0, href.length - 4);
var internalTitle:String = href.toUpperCase();
Gaia.api.goto(Pages[internalTitle]);

That is just an example, but basically you're converting  
"contact.html" to CONTACT and, there should be a public static const  
in Pages called CONTACT which has the branch for that title.


Does this make sense? (this part of the question is definitely  
appropriate for the Gaia forum, too)




On May 21, 2009, at 12:29 PM, Jonathan Wing wrote:

Thanks Steven! That clears a few things up, and like you suggest, I  
will
experiment with it until I get it just right. The only reason I've  
been

so anxious is that I'm working on a deadline; so, for the time being,
may I simply ask you this? What is the best (and most SEO-friendly)  
way

of presenting links within the copy content? Should I be doing this
within the XHTML using  tags to other swf files, or is there a  
better

method? I guess that is the only thing I'm getting hung up on, as my
pages will occasionally have links within the body paragraphs.

Okay, so I figured out one thing that helps, which is to set my text
fields to "htmlText" (it was only "text" before). That helps a lot,  
and
it appears that the links are showing up and they function--sorta.  
They
actually want to open a new page, even if a swf, and even if the  
target

is set to "_self".

Really, all I want to do (on my deadline) is have links from one swf  
to

another in the website, but have it all be SEO-friendly. Should be
pretty simple, right? I bet I'm making it more complicated for myself
than it probably needs to be. ;)

My I present my own guess, and you could tell me if I'm wrong? I'm
guessing it has something to do with the following, which I found in  
the

Gaia demo site (I'm pasting only what I assume is the relevant code):

public var textContent:TextField;

var myStyleSheet = new StyleSheet as StyleSheet;
var myURL:String;
var mySection:XMLList;

myURL = Gaia.api.getCurrentBranch();
myStyleSheet =
IStyleSheet(Gaia.api.getPage("index").assets.xmlCss).style;
textContent.styleSheet = myStyleSheet

for each ( var u:XML in mySection) {
if (myURL == u...@url) {
textContent.htmlText = u.copy;
}

Could I use this in tandem with my Gaia-produced XHTML pages? I do not
see where the actual  node is included in the instance from the
demo site's XML, but only the url part. How is the rest of the text
being included?

Sorry to be impatient! I just did not expect this specific aspect of
development to feel like starting from scratch!


Thanks,
Jonathan Wing
Graphic Designer
Cram Crew, Inc.
mobile: (713) 298-2738
office: (713) 464-CRAM (2726)
email: jw...@cramcrew.com
www.cramcrew.com

"One Student At A Time"


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Steven
Sacks
Sent: Thursday, May 21, 2009 1:43 PM
To: Flash Coders List
Subject: Re: [Flashcoders] Parsing HTML tags within flash from an  
XHTML

file?

http://www.gaiaflashframework.com/index.php/topic,1847.msg7817.html#msg7
817

Just so everyone is familiar with the context here, the above is the
thread on the forum about this.

The question is about how to use E4X to parse XHTML.  I provide a code
example of how easy it is to do this, but Jonathan's question is more
of a general one about how to use E4X to parse nodes.

Flash doesn't support  in its htmlText, so that's why you use E4X
to grab the node content like

var value:XML = XMLList(copy.innerHTML)[0];
var body:XML = value.div.(@id == "body")[0];

I believe the challenge for Jonathan is what the above lines of code
mean and how they work.

value is the XHTML.

value.div returns an XMLList of all div nodes on the first level
within the XHTML.

value.div.(@id == "body") means give me an XMLList of the div nodes
that have an attribute id="body".

valid.div.(@id == "body")[0] means give me the first XML node in that
XMLList.

This is how E4X works.  A lesson on E4X is out of scope of my forum.
However, there are lots of resources out there for E4X in AS3.  I
highly recommend Colin Moock's Essential Actionscript 3.0 book, which
is how I learned it.  That and the internet.

And Jason, you do not need t

Re: [Flashcoders] Parsing HTML tags within flash from an XHTML file?

2009-05-21 Thread Steven Sacks

http://www.gaiaflashframework.com/index.php/topic,1847.msg7817.html#msg7817

Just so everyone is familiar with the context here, the above is the  
thread on the forum about this.


The question is about how to use E4X to parse XHTML.  I provide a code  
example of how easy it is to do this, but Jonathan's question is more  
of a general one about how to use E4X to parse nodes.


Flash doesn't support  in its htmlText, so that's why you use E4X  
to grab the node content like


var value:XML = XMLList(copy.innerHTML)[0];
var body:XML = value.div.(@id == "body")[0];

I believe the challenge for Jonathan is what the above lines of code  
mean and how they work.


value is the XHTML.

value.div returns an XMLList of all div nodes on the first level  
within the XHTML.


value.div.(@id == "body") means give me an XMLList of the div nodes  
that have an attribute id="body".


valid.div.(@id == "body")[0] means give me the first XML node in that  
XMLList.


This is how E4X works.  A lesson on E4X is out of scope of my forum.   
However, there are lots of resources out there for E4X in AS3.  I  
highly recommend Colin Moock's Essential Actionscript 3.0 book, which  
is how I learned it.  That and the internet.


And Jason, you do not need to complicate things with RegEx.  E4X does  
enough.  XHTML is technically XML and can be parsed the same using E4X.


Also, while Flash doesn't SEEM to support newer HTML tags like  
 and  for  and , it actually DOES if you write css  
to do it.


strong {
font-family: FFScala-Bold;
display: inline;
}
em {
font-family: FFScala-Italic;
display: inline;
}

In this case, I am using a bold and italic font to show them, and by  
defining the node types in css (and setting them to display: inline),  
it works like a champ!


Here's a detailed code sample:
http://www.gaiaflashframework.com/wiki/index.php?title=Runtime_Font_Loading#StyleSheet_Example

Now, I can keep my valid XHTML and use it directly in Flash.  It's  
really straightforward.  The challenge is learning how to parse the  
nodes using E4X, which, once you get your head around it (and it took  
me a lot of experimenting to learn how awesome and powerful E4X is and  
how to leverage it), you can do stuff like this easily.

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


Re: [Flashcoders] XML Sorting Question

2009-05-21 Thread Steven Sacks
My advice is to use the wonderful encyclopedia available to you called  
"The Internet".


I went to Google and typed in:  sort xml AS3

The first 4 results have the exact code you need to do this.

The Internet: Helping people find answers, one search at a time.



On May 21, 2009, at 7:25 AM, Dominic Tancredi wrote:


Hey All!

I have a weird xml sorting question. I'm retrieving a folder  
hierarchy and displaying it in flex using a tree (yes yes, flex, but  
it's an actionscript question). However, I'm requested to make the  
results alphabetical. So that's either XSL server-side, or sort the  
results in actionscript.


I was able to put together actionscript to sort the top level of XML  
(by creating objects in an array, sorting the array by the  
attribute, then creating a new xml based on the array), but figuring  
out the recursion to sort each of its children is... driving me  
nuts. Do any of you have advice on sorting hierarchical xml data?


XML is like this:











I can show my sortXML code if you have any q's.

Dom
___
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 Steven Sacks

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


Re: [Flashcoders] JSON Experiences

2009-05-20 Thread Steven Sacks
If your XML has namespaces (like YouTube's xml feeds), then, yes, JSON  
is easier to implement.


Namespace support in E4X is the very definition of "Royal Pain In The  
Arse".


It's why the AS3 code lib for YouTube uses their JSON feed instead.   
It's just too ridiculous to deal with all those namespaces.


However, without namespaces, E4X is far more powerful than JSON, IMO.





On May 20, 2009, at 11:42 AM, Gregory Boland wrote:


Dear list,

I am looking into using JSON to bring data into Flash as opposed to  
XML and
I wondering what other people's experiences have been with it.   
People tell

me that its much easier to use than xml and easier to implement.

Does anyone know of a good place to see some AS3 code that uses JSON  
so i

can see how it works?

thanks

greg
___
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 there an AS3 equivalent of AJAX Suggest (like Facebook autofill searchbox)? is it even possible?

2009-05-15 Thread Steven Sacks

Like the search on this site?

http://www.dermalogica.com/us/#/home

It's actually super easy to do this.


On May 15, 2009, at 12:48 PM, Carl Welch wrote:


Hi all,

I need to make an AS3 version this:
http://www.w3schools.com/ajax/ajax_example_suggest.asp

I'm thinking I'll query the database for all of the users store that  
in an array or xml and then attach a listener to the textfield that  
will search the array everytime a character is added to the textfield


Has anyone out there attempted anything like this? Anyone know of an  
existing class?



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


Re: [Flashcoders] FileReferenceList - no upload function?

2009-05-15 Thread Steven Sacks

http://74.125.155.132/search?q=cache:Z9ZpwotYRtkJ:www.mikestead.co.uk/2009/01/04/upload-multiple-files-with-a-single-request-in-flash/+AS3+Socket+send+progress+broken&cd=3&hl=en&ct=clnk&gl=us&client=firefox-a


On May 15, 2009, at 11:19 AM, Paul Freedman wrote:

I haven't had to build ftp functionality in years. I hope someone is  
familiar with the problem and can address this simply.


The class FileReference allows the user to browse to and select one  
file, and the class FileReferenceList allows for the selection of  
multiple files. But only FileReference has an upload() function.


How do you upload (or download, for that matter) using  
FileReferenceList?


___
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 Steven Sacks

Encrypt your text using a super crazy encryption algorithm.

Then, create a swc that contains the key and algorithm to decrypt the  
text.


Then, encrypt that swc using another super crazy encryption algorithm.

Load the swc at runtime as raw bytes, decrypt it in memory, and then  
instantiate it as the class you need.


Decrypt the text.

Null out the swf instance and the bytes.

Force the gc to run.

That's about as protected as you can get.  Obviously, you'll need a  
pretty strong challenge response system in place to get the shared key  
to decrypt the swc in memory.


Don't know how to do this?

Watch this:  http://onflash.org/ted/2008/10/360flex-sj-2008-encrypting-flex.php
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Embed Fonts in Main SWF

2009-05-07 Thread Steven Sacks

You can embed specific ranges like this:

http://www.gaiaflashframework.com/index.php/topic,1678.msg7436.html#msg7436

If you put the font in the library, you can just set the font to  
export in frame 1, give it a class name and then


Font.registerFont(fontClassName);

Easy peasy.


On May 7, 2009, at 9:51 AM, Dav wrote:


Hi guys, simple question for you!

If I have a main swf file that has font's embedded via AS3.
I load a child swf into a movieclip on the main swf.
Can the child swf use the embedded fonts from the main swf?

I've tried and so far I haven't managed to get this working,  
obviously if I

embed the fonts into the child swf the fonts appear as expected.

Cheers!
Dav

___
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] Adobe AIR Mailing List?

2009-04-24 Thread Steven Sacks
Rad.  I've blogged and twittered about it.  I suggest everyone else do  
the same!



On Apr 24, 2009, at 7:21 AM, Merrill, Jason wrote:


and give the group a name like
FlashTiger, I made Air-Tight.


Great name, I love it.


Jason Merrill

Bank of  America   Global Learning
Shared Services Solutions Development

Monthly meetings on the Adobe Flash platform for rich media  
experiences

- join the Bank of America Flash Platform Community

___
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] Adobe AIR Mailing List?

2009-04-23 Thread Steven Sacks
Anyone know of an active Adobe AIR mailing list (like Flashcoders/ 
Flash Tiger)?


Apollocoders is basically dead, and all posts are moderated.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] flickr api as3

2009-04-20 Thread Steven Sacks

Hilarious.

On Apr 19, 2009, at 5:17 PM, Peter B wrote:


Ha! Know what's crazy there? Your post Stephen, and the OP are now the
number 3 & 4 results from that search...
___
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] flickr api as3

2009-04-17 Thread Steven Sacks

http://tinyurl.com/d67kuy


On Apr 17, 2009, at 1:02 PM, Preston Parris wrote:

Does anyone have a good example of loading thumbnails from flickr,  
and then
once you click on that thumbnail, loading a larger version of the  
picture
from flickr still in the flash. Everything i have found links to the  
flickr

page after showing the thumbnails.

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


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


Re: [Flashcoders] Favorite Flex book?

2009-04-14 Thread Steven Sacks

>This book obviously wasn't meant for your learning style, but it was for me.


Different strokes for different folks!  :)
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Favorite Flex book?

2009-04-14 Thread Steven Sacks

 > For training, I like the Adobe Flex training from the source book(s).

I personally did not like this book at all.

Here's how the book goes:


Build this like this.

Build that like that.

Now, you know how you built this and that?  That's the wrong way to build it, so 
we're going to refactor everything and build it this new way.


Ok now build on what we just did.

Build again.

Yeah, you know what we just spent a few chapters doing?  That's the incorrect 
way to build stuff, so we're going to completely redo what we've done so far.



This pattern repeats itself to the end of the book.  It's a terrible way to 
teach something.  "We'll teach you the wrong way, then we'll tell you it's the 
wrong way after you already learned the lesson."  Do they know nothing about the 
learning process?  Apparently so.

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


Re: [Flashcoders] Storing x and y in a bytearray

2009-03-31 Thread Steven Sacks

http://polygonal.de

If you want to learn about maximum optimization for collision detection, etc. 
nobody knows more than this guy.

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


Re: [Flashcoders] RE: Interactive Developer, NYC | 90-100k (Beau Gould (OSS))

2009-01-01 Thread Steven Sacks

Not really.  That's far less than I work for.

alan skinner wrote:
 
Surely thats not the going rate for a flash developer in the US?

Thats an obscene amount of money ;o)
 
 
_

It’s the same Hotmail®. If by “same” you mean up to 70% faster.
http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_broad1_122008___
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] use get / set functions or make your own

2008-12-10 Thread Steven Sacks

It is incredibly rare that I agree with Steven.


I resemble that remark! ;)
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


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

2008-12-10 Thread Steven Sacks

Thankfully, AS3 allows you to put implicit getters and setters into an 
interface.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


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

2008-12-10 Thread Steven Sacks

And just to clarify:

Stand on the shoulders of giants, don't follow in their footsteps.


Steven Sacks wrote:

Keyword: Old.

Hans Wichman wrote:

ps we're probably not the first ones discussing this old subject, has n1
found some good sources/references?
Most of the old CS textbooks sentence you to hell for using public 
variables

so let's not refer to those ;)

___
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] video seek ability

2008-12-10 Thread Steven Sacks

> Make sense?

bytesTotal = 100% * width;
duration = 100% * width;

bytesLoaded / bytesTotal = 0%-100% * width
time / duration = 0%-100% * width

The relationship between bytesLoaded and time is 1 to 1, which is why my 
scrubber logic is flawless.  That's where you went off the track.  Eek, a pun!


-Steven


Muzak wrote:
If I'm not mistaken, there's a flaw in the logic, as the progress is 
based on bytesLoaded and bytesTotal, while the shuttle/scrubber is time 
based.
Only the beginning and end of both will match up (0% loaded = 0 time -- 
100% loaded = total time).


Make sense?

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

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


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

2008-12-10 Thread Steven Sacks

Keyword: Old.

Hans Wichman wrote:

ps we're probably not the first ones discussing this old subject, has n1
found some good sources/references?
Most of the old CS textbooks sentence you to hell for using public variables
so let's not refer to those ;)

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


Re: [Flashcoders] video seek ability

2008-12-09 Thread Steven Sacks

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

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

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


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


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



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

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


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

2008-12-09 Thread Steven Sacks

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

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

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


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


I opt for implicit over explicit because this:

foo.prop = value;

makes more sense than

foo.setProp(value);

I leave methods for methods, not properties.

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


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

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

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



On the FlashDevelop tip:
http://www.stevensacks.net/2008/02/21/flashdevelop-code-generation/

http://www.stevensacks.net/2008/04/30/flashdevelop-flexbuilder-style-error-reporting-on-save/

FlashDevelop's auto-completion and code generation are better than anything out 
there (for AS, at least).  And just to be clear, you don't need to select 
anything for code generation, the cursor just needs to be anywhere within the 
word, or at the end of the statement.


private var _test:Boolean;

If the cursor is after the semicolon, you can press the shortcut (I use ALT+2 on 
Windows, CMD+2 on OSX) and it will bring up the code generation options.  The 
event generation is really valuable, as well.  I save so much time with it.


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


Re: [Flashcoders] Loader bytesTotal equals to 0

2008-12-04 Thread Steven Sacks
Just for clarification, it was 4 bytes (the size of an empty MovieClip in AS2). 
   I don't know if it's the same in AS3 (don't care enough to look into it).


I don't think that's the issue he's having.  I think he's saying the bytesLoaded 
is returning correctly, but the bytesTotal is 0 the entire load.


Unfortunately, I don't have a solution.



Glen Pike wrote:

Hi,

   Are you waiting until the totalBytes > 7 (or some other small value)  
First time round on some preloaders I have noticed that totalBytes was 
0, so put in a catch for this:


   if(lb == tb && tb > 7) {
  loaded = true;
   }

Christian Giordano wrote:

I've a strange bug which seems on the Flash Player. Basically on
Windows / IE when the page is reloaded, the preloader logs the
progress of the bytesLoaded correctly, but the totalBytes are
incredibily 0. I tried both to check the ProgressEvent or the
loader.contentLoaderInfo itself, the result doesn't change.

I am wondering if anyone have ever encountered in this absurd issue (I
couldn't find anything on the web).


Thanks, chr
___
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] structuring singletons in AS3

2008-12-02 Thread Steven Sacks

Why aren't you using a static class for that instead of a Singleton?


Mendelsohn, Michael wrote:
Thanks for the responses everyone. 


Steven, I could use some constructive feedback:

Usually what I do is have a singleton instanced when the swf is
initialized, and using composition, other classes are instanced within
the singleton.  So the singleton becomes a sort of tree trunk with
everything branching off of it.  How would you say that this is a bad
idea?  It's worked well for me.  What would be a more effective
alternative to structuring my swfs?

- MM



Singletons are overused and, except in rare instances, are a bad idea.

Singletons are acceptable if you're writing throwaway code, like agency
stuff 
where getting it done under tight deadlines is more important than
getting it 
done in the most scalable and flexible way.


A Singleton is just a global.  IMO, globals are helpful when hacking,
but 
generally bad practice. If it was called Globalton, people wouldn't
think so 
highly of it just because it's a "Design Pattern".  Most people misuse 
Singleton, anyway.


http://misko.hevery.com/2008/08/17/singletons-are-pathological-liars/

http://googletesting.blogspot.com/2008/05/tott-using-dependancy-injectio
n-to.html

http://googletesting.blogspot.com/2008/08/where-have-all-singletons-gone
.html


Google even has a tool that detects Singletons in Java so you can
refactor them out.

http://linux.softpedia.com/get/Programming/Quality-Assurance-and-Testing
/Google-Singleton-Detector-29295.shtml

___
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] structuring singletons in AS3

2008-12-02 Thread Steven Sacks

Singletons are overused and, except in rare instances, are a bad idea.

Singletons are acceptable if you're writing throwaway code, like agency stuff 
where getting it done under tight deadlines is more important than getting it 
done in the most scalable and flexible way.


A Singleton is just a global.  IMO, globals are helpful when hacking, but 
generally bad practice. If it was called Globalton, people wouldn't think so 
highly of it just because it's a "Design Pattern".  Most people misuse 
Singleton, anyway.


http://misko.hevery.com/2008/08/17/singletons-are-pathological-liars/

http://googletesting.blogspot.com/2008/05/tott-using-dependancy-injection-to.html

http://googletesting.blogspot.com/2008/08/where-have-all-singletons-gone.html


Google even has a tool that detects Singletons in Java so you can refactor them 
out.

http://linux.softpedia.com/get/Programming/Quality-Assurance-and-Testing/Google-Singleton-Detector-29295.shtml
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] AIR execute file .bat

2008-11-24 Thread Steven Sacks

No.


david costard wrote:

Hi List,

Is it possible to execute a .bat file from an AIR application ?


david
___
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] frameworks and flash

2008-11-15 Thread Steven Sacks

Joel,

Considering the types of Flash sites you're talking about building, Flex is not 
the solution you need.  However, Flex is absolutely worth learning, if only to 
expand your skillset which leads to making more money per hour. ;)


Out of all the frameworks you listed, only Gaia is for making the types of 
websites you said you are making.  The rest are application frameworks. 
PureMVC, Mate and Cairngorm are primarily intended to work with Flex and any 
support you seek on learning those frameworks will most likely come from Flex 
developers and not Flash ones.  They are important to learn if and when you 
learn Flex.


Gaia AS3 is only 40k (AS2 is slightly smaller).  I hate code bloat and have 
spent a lot of effort keeping Gaia as lean as possible.  There's even an option 
to optimize the main.swf by removing any assets you aren't using in your site, 
which can potentially decrease the file size down to 29k.


A lot of developers and designers making the transition from AS2 to AS3 have 
found Gaia very helpful in that process, since it takes care of a lot of the 
extra code that is so overwhelming, and gives you time to slowly acclimate to 
the changes.


Gaia also has an active forum with over 800 members, a robust Wiki and 
documentation, ASDocs, and I am available on the forums every day answering 
questions.


If you're going to be at MAX, come check out my Gaia presentation on Tuesday at 
4:00pm.


http://360max.wikispaces.com/Gaia+Framework

Cheers and good luck!

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


Re: [Flashcoders] What is the ActionScript equiv. to HTML ?

2008-11-01 Thread Steven Sacks

On that last frame of the timeline of the playing clip:

stop();


William Adams wrote:
I'm loading a Flash file in a MovieClip and I want it to play once and 
then stop, but it keeps looping. Endlessly. How can it be set to play 
once and then stop / not loop?


Thanks!

William


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


Re: [Flashcoders] AS3 - Checking if a Function Exists

2008-10-29 Thread Steven Sacks
There's a bug if you return in a try or catch (maybe it's just catch).  Colin 
Moock mentions it in his AS3 book.  I personally think it's cleaner to return 
after a try catch because try catch is not an if else and really shouldn't be 
treated as such, but that might be because I have avoided returning inside them 
since I first started using them because of the bug.

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


Re: [Flashcoders] AS3 - Checking if a Function Exists

2008-10-28 Thread Steven Sacks

Do not call return in a try catch.


Ian Thomas wrote:

Method:

public static function refExists(obj:Object,name:String):Boolean
{
try
{
if (obj[name]!=null)
return true;
}
catch (e:ReferenceError) {}
return false;
}

HTH,
   Ian

On Tue, Oct 28, 2008 at 8:36 AM, Ian Thomas <[EMAIL PROTECTED]> wrote:

Or, thinking about it, you could catch the reference error in a
try/catch block. It's more of a kludge, but might give you much higher
performance!

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 - Checking if a Function Exists

2008-10-27 Thread Steven Sacks

if (currentSection.refresh)
{
currentSection.refresh();
}

Karim Beyrouti wrote:
Hello Group - 


This should be really easy. I am trying to find out how to check if a
function exists or not in AS3 - 
I tried this: 



If ( currentSection.refresh != null ) {
currentSection.refresh();
}




But I get "ReferenceError: Error #1069: Property refresh not found" when the
function does not exist.

Any clues?


Kind Regards



Karim

___
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] AIR: Drag and Drop between NativeWindows

2008-10-21 Thread Steven Sacks
I'm trying to figure out how to do drag and drop between two NativeWindows.  Not 
drag and drop between the OS and AIR, and not drag and drop in the same window, 
but between two NativeWindows of the same AIR application.  I've tried all 
manner of guessing, and I can't find a single example on google of how to do 
this.  From the stage.mouseX on the "drag to window" returning impossible 
numbers (like 65710) to Rectangle intersects not responding in reliable ways.


If you have experience doing this, please let me know how to do it.  If you have 
never done this, please don't respond with your guesses.

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


Re: [Flashcoders] CDATA whitespace issue

2008-10-16 Thread Steven Sacks

And derivatively, a way to grab the entire contents of a node as one big string:

http://www.gaiaflashframework.com/index.php/topic,918.0.html
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] CDATA whitespace issue

2008-10-16 Thread Steven Sacks

http://www.stevensacks.net/2008/07/02/parsing-xhtml-with-e4x-in-as3/
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Can you embed .mp4 files in timeline?

2008-09-24 Thread Steven Sacks

No.

Matt Ganz wrote:

Hey,

Just trying one more time

Using Flash CS3 and publishing to flash player 9, can you import and embed
.mp4 files in the flash timeline? I can't. I can link to it via an
flvplayback component.

Thanks,

Matt
___
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] AIR WebKit browser breaks when internet is slow

2008-09-23 Thread Steven Sacks
If a web page is having latency problems, like YouTube during heavy load times 
(like now, 9:30pm PST), then AIR's HTMLLoader has all kinds of problems.


From rendering stuff completely incorrectly, to failing to pass Flash player 
detection, to this crazy error that got spit out when I tried to load a YouTube 
URL in it and it hung for about 20 seconds until finally this junk was spit into 
the output window:


ReferenceError: Can't find variable: initWatchQueue
undefined at http://www.youtube.com/watch?v=RbdbVhBGETQ : 77
ReferenceError: Can't find variable: writeMoviePlayer
undefined at http://www.youtube.com/watch?v=RbdbVhBGETQ : 375
undefined at http://www.youtube.com/watch?v=RbdbVhBGETQ : 375
ReferenceError: Can't find variable: delayLoad
onload at http://www.youtube.com/watch?v=RbdbVhBGETQ : 1646
ReferenceError: Can't find variable: delayLoad
onload at http://www.youtube.com/watch?v=RbdbVhBGETQ : 1585
ReferenceError: Can't find variable: delayLoad
onload at http://www.youtube.com/watch?v=RbdbVhBGETQ : 1524
ReferenceError: Can't find variable: delayLoad
onload at http://www.youtube.com/watch?v=RbdbVhBGETQ : 1545
ReferenceError: Can't find variable: delayLoad
onload at http://www.youtube.com/watch?v=RbdbVhBGETQ : 1667
ReferenceError: Can't find variable: delayLoad
onload at http://www.youtube.com/watch?v=RbdbVhBGETQ : 1565
ReferenceError: Can't find variable: delayLoad
onload at http://www.youtube.com/watch?v=RbdbVhBGETQ : 1687
ReferenceError: Can't find variable: delayLoad
onload at http://www.youtube.com/watch?v=RbdbVhBGETQ : 1626
ReferenceError: Can't find variable: delayLoad
onload at http://www.youtube.com/watch?v=RbdbVhBGETQ : 1606
TypeError: Undefined value
undefined at http://www.youtube.com/watch?v=RbdbVhBGETQ : 1
undefined at http://www.youtube.com/watch?v=RbdbVhBGETQ : 1
Debug session terminated.


Note that none of these variables are mine.  Also note that Firefox doesn't have 
the same latency that AIR is having.  This is running in Flash CS3 IDE Debug 
Mode AIR publishing.  Trivial code here, too.  I'm literally just creating an 
HTMLLoader and telling it to load this YouTube URL.


Any ideas?

I'd like to point out that Firefox actually loads that same URL fairly quickly 
(maybe 5-7 seconds with latency) but AIR is significantly slower every time. 
Sometimes it succeeds at loading it and rendering the page correctly, sometimes 
it loads the page but the YouTube player is drawn above the stage about half its 
height, sometimes it crashes Flash when it hangs too long.

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


Re: [Flashcoders] OT: how many coders here actually have a degree related to computer science?

2008-08-22 Thread Steven Sacks
I may not have a CS degree, but I do know that off-topic posts are supposed to 
have a leading OT: in front of them.  What gives?  ;)


Kerry Thompson wrote:

John Winkelman wrote:


Well, I got my degree in Russian Studies, which means I can read all of my
spam. 


LOL. It must be Friday.

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] AS2 Dispatch Custom Event of loaded clip

2008-08-17 Thread Steven Sacks

Wow.  That's a crazy amount of code for something so simple.

Here's what I use:

---
import mx.events.EventDispatcher;

class net.stevensacks.utils.ObservableClip extends MovieClip
{
public var addEventListener:Function;
public var removeEventListener:Function;
private var dispatchEvent:Function;

function ObservableClip()
{
EventDispatcher.initialize(this);
}
}
---

Just have your MovieClip classes extend ObservableClip instead of MovieClip and 
you can addEventListener and dispatchEvent simply and easily.


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


Re: [Flashcoders] urgent TweenMax easing question

2008-08-13 Thread Steven Sacks

Select your transparent PNG and press CTRL+B (Break Apart).

Then, use the lasso tool and the eraser tool to erase the transparent pixels as 
best you can.


This will increase your performance a lot because Flash won't have to render 
those transparent pixels anymore.

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


Re: [Flashcoders] Upload PDF into SWF?

2008-08-11 Thread Steven Sacks
You cannot load a PDF into Flash.  You must have misread any article that you 
think said you could.



ali drongo wrote:

Hiya, does anyone know the best way to get a PDF into my SWF as a viewable,
scalable moveiclip?I've done a bit of research on this but most articles I
find are a few years old.
I would like the user to be able to upload a pdf then view it in the flash
application and move it about, scale and rotate it. I've come across Alive
PDF which seems to let you download a PDF from a flash app but I would like
to do this the other way around, in AS2 or AS3.

Any suggestions / advice gratefully received :)
Thanks
Ali
___
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] BUG: channel.position doesn't work with mp3s below 128kbps

2008-08-07 Thread Steven Sacks
Man I just keep finding more and more bugs with Sound.  This one is actually 
really bad because it has no workaround, unlike the others.


If you have an mp3 file that is less than 128kbps and you get its 
channel.position at a particular point in time and try to play from that 
position it jumps ahead in the file.  The amount it jumps ahead is based on how 
far away it is from 128kbps (a 56kbps file will jump more than a 64kbps one).


But wait, it gets worse.

Even though it has jumped ahead in the track, the channel.position returns where 
it's supposed to be, not where it actually is!!  That's right!!


channel.position says it's at 5000ms but it's actually somewhere around 8000ms, 
etc. and so on.   I'm updating the position in a TextField in an ENTER_FRAME 
listener.


Wow.  I mean, just, wow.  128kbps and up works just fine.  Anything less and 
you've got a bug.


I've discovered so many bugs in the Sound class in the last 12 hours, it's kind 
of disheartening.  I'm losing faith in the Flash player team and in Adobe for 
letting this kind of stuff get through QA.



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


Re: [Flashcoders] AS3 frustration - help get component working

2008-08-07 Thread Steven Sacks
The issue isn't Gaia.  If you try to load that component living in a child swf 
into a parent swf it doesn't work.


Many component authors never take into account the extremely common use case of 
loading their component into another swf.  Many PV3D components I have seen 
suffer from this exact problem.

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


[Flashcoders] Re: Another Sound Bug - transform.pan

2008-08-07 Thread Steven Sacks
Update: Unfortunately, it looks like even if you set the pan all the way in one 
direction or the other, it doesn't actually work. You can still hear the sound 
coming out of the side that it is panned away from. So, I guess this bug is moot 
since pan doesn't actually work properly in the first place.


Jeez.  The more I use the Sound class, the more I'm unimpressed with Adobe's 
quality control.

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


[Flashcoders] Another Sound Bug - transform.pan

2008-08-07 Thread Steven Sacks

var snd:Sound = new Sound();
snd.load(new URLRequest("assets/sample.mp3"));
var ch:SoundChannel = snd.play();
var st:SoundTransform = ch.soundTransform;

st.pan = 1;
ch.soundTransform = st;
trace(st.pan);
trace(ch.soundTransform.pan);

st.pan = -1;
ch.soundTransform = st;
trace(st.pan);
trace(ch.soundTransform.pan);

Output:
1
1
-1.0004
-0.98809998

You can CLEARLY see me set the pan to 1 and then -1.  But, if you notice, the -1 
pan is a bit below -1 on the transform, but when you apply the transform to the 
channel, it goes above -1.


I've got a sound mixer than I can set the volume on left and right individually 
and I hear the sound on the right when it's at -0.988, but I cannot hear the 
sound on the left when it's at 1.


How many more bugs are there in the Sound class?
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] BUG: Channel.position returns out of range positions on looping Sounds

2008-08-07 Thread Steven Sacks
Modulus works, too, but that doesn't solve the issue that looping sounds return 
out of range values, nor does it fix the issue that channel doesn't have a 
proper pause() method like NetStream does.


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


[Flashcoders] BUG: Channel.position returns out of range positions on looping Sounds

2008-08-07 Thread Steven Sacks

I don't know if this has been documented or not.  I've never seen anyone report 
it.

If you set a Sound to loop, it's channel.position property returns a number out 
of range of the Sound.length after it loops.  The position property just keeps 
on incrementing beyond the length when you loop a sound.


If you try to play a Sound from that out of range position, the Sound glitches 
out, because that position is invalid.  Flash should not return a position to 
you that you cannot use.


This all revolves around the fact that Sound has absolutely no way to pause 
right now.  I don't know why Adobe did not give us a channel.pause() method, but 
they didn't.  Because they didn't, this bug gets worse.


The only way to pause and unpause a sound in Flash is to store the current 
position of the channel and call channel.stop, and when you unpause, you call 
sound.play(position).


If the sound is looping, the position returned will eventually be higher than 
the length, which means the Sound glitches because you're passing an out of 
range position, a position, once again, that Flash returned to you as VALID.


Wait, it gets worse.  If you unpause a looping sound by passing its position, 
when it loops, it will loop from that position, not the beginning of the Sound. 
 Do you see how this gets worse?


There is no pause method, and without a pause method, there is no workaround for 
the above bug and issue except to manually loop a Sound by adding an event 
listener to the sound complete event (which can be unreliable), and calling play 
on it again and managing the looping manually, which undermines the loops 
argument of the Sound.play() method and requires a fair amount of code.


We need a channel.pause(flag:Boolean) method.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Flashdevelop + Flex SDK - runtime error

2008-08-06 Thread Steven Sacks

http://www.stevensacks.net/2008/04/30/flashdevelop-flexbuilder-style-error-reporting-on-save/


Leandro Ferreira wrote:

How do you guys debug your movies using FlashDevelop + Flex SDK?

   Leandro Ferreira
___
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 Destructors and Garbage Collection ...

2008-08-02 Thread Steven Sacks
It's a dangerous business removing instances when there are still 
references to them. Check out as3 weak references.


So dangerous that you can't do it.  ;)

The Flash 10 Player has a function to force the GC to run, btw.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] OT: Questions to ask an interviewee

2008-07-30 Thread Steven Sacks
There's a company here in LA that gives you a choice of tests and you can take 
them home and work on them.  I heard what one of the tests was at 1:00am late 
one night and I was so psyched about it that I ended up staying up til 5:30am 
doing it.  I wasn't happy with my first solution, which worked but wasn't as 
elegant as I liked, so I refactored it until I was satisfied.


The particular test I took I thought was a fantastic way to figure out 
somebody's problem solving skills.  I heard the next day that most applicants 
failed that particular test, including the guy who told me about it!  (I can 
imagine it causing the Flash player to have script timeout errors).


I mean, you have to come up with a good challenge worth doing.  You'll also get 
an idea of how passionate people are about coding by giving them a challenge.  I 
want to interview at that company just so I can find out what their other tests 
are and take em, ha!


Here's what you have to decide.  What are you trying to determine about 
somebody's skillset?  Do you do a lot of collision detection stuff?  Are you 
more interested in design pattern knowledge?  Once you know what the goal is, 
you can come up with a test that will demonstrate their skills in that area.


No, I'm not going to tell you what the test is.  :)
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] OT: Questions to ask an interviewee

2008-07-30 Thread Steven Sacks
Don't ask questions.  You won't learn anything.  Make him code some stuff. 
Something tricky.  Come up with something good.  That is, if you care if they 
know how to code.


Nevermind.  You should ask him what his strengths and weaknesses are.  Those are 
always good interview questions.

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


<    1   2   3   4   5   6   7   8   9   10   >