Re: [Flashcoders] hen's teeth...

2010-01-08 Thread Ron Wheeler

A big +1 for the Head Start Design Patterns book.
A must read for anyone wanting to write clean functional code. Saves 
days of reinventing poorly crafted wheels.


Ron

Bob Wohl wrote:

This thread has been a good read. Over the years I've been tasked to write
multiple server languages and I've learned a great deal from that. PHP, ASP,
.NET, Java and now Grails. I haven't mastered any of them but I can
understand them, write them and do it correctly. I suppose my next language
after I master Grails should be C# since everyone says its pretty simple to
pick up.

I think the one language I've learned the most from is Java. The OOP lessons
I've learned have really accelerated my AS3 development and approach. I kind
of wish I would have read more Java related books when trying to learn AS3
as just going through the tutorials and reading design patterns (head start
book) have opened my eyes on so many concepts and methods for programming.
It really would have made learning OOP with AS3 so much easier.

The big thing I look for when choosing a language to learn/write is what
can it do for me.


On Tue, Jan 5, 2010 at 8:32 AM, Dave Watts dwa...@figleaf.com wrote:

  

I think Adobe is rather missing a trick in not having a stand-alone
  

version


of Actionscript.
  

Really? AS3 is really just an environment-specific implementation of
the latest JS specifications, along with class libraries that make
sense in Flash Player. I don't think it really brings anything to the
table that I can't get in C# or Java in other environments.



Yes, you're right, but in the context of someone wanting to learn AS3 as
  

a


primary goal not general programming, such things aren't such an issue.
  

I think you've been spoiled by your CS background, where you learned
how to program before you learned how to solve domain-specific
problems.



I have interpreted the original question as Do I need to learn language
  

X


to become an AS3 programmer and the answer is most definitely No.
  

I didn't interpret the original question the same way, but if I had,
I'd agree with you.



There's no harm (and much to be gained) in learning subsequent languages
once the principle concepts are grasped with the first language. What is
  

a


mistake is to try and learn two new languages at the same time and it
  

would


also be misleading to say that learning another language is a
  

prerequisite for


learning AS3.
  

I'm not sure I agree with this. I think it can be useful to learn two
languages simultaneously, and see the separation between
language-specific syntax and algorithms, etc. But we can agree to
disagree on this.



You mention concurrency and that is something Adobe needs to address (I'm
sure it won't be easy to make the Flash infrastructure thread safe) and
  

we


both know that it will improve performance greatly in the player where
  

there


are multiple cores available. I'm sure it will also swell the posting on
flashcoders!
  

I mentioned concurrency as an example, but there are lots of other
examples I could have used instead.



Currently it's necessary for developers to know Actionscript for Flash
  

and


Flex plus something else for server interaction. I'd rather see the
  

second


language being useful to allow people to complete their pipeline to the
server than be a language that may not suit that well. It's also
  

important


in these economic climes, that the effort put in suits the market demand
  

for


expertise. It's unfortunate in some ways that Adobe haven't pushed the
  

boat


a little further with a good server-side actionscript implementation to
  

make


that access to data even easier.
  

C# and Python are perfectly good languages for building web
applications, though. PHP, on the other hand, isn't good for building
anything but web applications. Plus, in my own opinion at least, C#
and Python have more internal consistency in their design than PHP
does - PHP is more a product of accretion than design, if you know
what I mean.

I'm not sure a server-side ActionScript implementation makes much
sense from a business perspective, with all the very capable, mature,
and commonly-used web application environments that already exist.



A lot of people want to learn Actionscript and I'd rather they didn't
  

think


that they had to learn another language to do so, or mistakenly attempt
  

to


take on two new languages as an entry to programming at the same time.
  

Well, that's all true if you want to learn ActionScript. But many
people presumably want to learn AS in order to build web applications,
which potentially involve all sorts of moving parts - AS, HTML and JS
on the client, some application server in the middle, SQL on the
database.

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


Re: [Flashcoders] hen's teeth...

2010-01-05 Thread Ron Wheeler

Dave Watts wrote:

So would you say it would be advantageous for aspiring Flash programers to
learn C#?
Or leave it alone, not needed? I hear they are very similar as well.
I was wondering what the benefits would be.



AS3 and C# are very similar, yes.

I think it's advantageous for aspiring programmers to learn more than
one language, especially if one of the languages they're learning is
domain-specific, like AS3. I think C# would be a fine choice for an
alternate language to learn, although it might actually be better to
choose something that isn't so similar, like Python.

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

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

  
You could also look at haXe which can produce output that juns on a 
number of Virtual machines including the FlashPlayer.

It can also use Flash objects.
It is strongly typed to encourage good programming practices.
www.haxe.org.
It has a strong user community that can be very helpful to people 
starting out.


Ron


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


Re: [Flashcoders] hen's teeth...

2010-01-05 Thread Ron Wheeler

Paul Andrews wrote:

Dave Watts wrote:

Perhaps you can explain how AS3 is narrow. For years Pascal was THE
language to learn programming then eventually it migrated to Java 
and I
don't consider AS3 to be a limited language or narrow in it's 
outlook. I

think it's rather a good and accessible first language to learn.



AS3 is designed to do one thing: build Flash applications. Pascal and
Java are both general-purpose programming languages. You can build all
sorts of different programs in them, and more importantly, you can
build programs that are really nothing but wrappers for specific
examples, without a lot of extra infrastructure needed to run them.
You can write a single Java class and run it from a command prompt.
  
I think Adobe is rather missing a trick in not having a stand-alone 
version of Actionscript.
You can use MTASC http://www.mtasc.org/ if you want to write and compile 
Actionscript outside of the Adobe IDE.
If you move to haXe, you can code using several different IDEs(Eclipse 
is my choice) and run on a wide choice of VMs (FlashPlayer, JavaScript, 
PHP,  C++ and more).



 
Your main point may be that AS3 is really a client side language, 
I'm really
not sure what you perceive as a limitation. As a language it 
supports just
about all the notions of a modern OO language, so I don't think it's 
really

limiting at all.

Most of the programming principles from Java and the like are easily
implemented in AS3, so I have no idea where the problem is.



Dealing with concurrency is a common programming problem. I wouldn't
want to demonstrate concurrency solutions in AS3.

Writing a simple, argument-driven hello world program is far easier
in Pascal or Java (or especially Python) than AS3.
  
Yes, you're right, but in the context of someone wanting to learn AS3 
as a primary goal not general programming, such things aren't such an 
issue.
 
I would suggest PHP, not as an AS3 look-alike, but as a good 
compliment to

AS3 - as good as C# as a companion to As3 in the real-world.



Sure, PHP is a good complement to AS3, as both can be used to build
different parts of web applications.

But again, I submit that there is value in learning a general-purpose
programming language, which isn't limited to building web
applications. The point of learning a second (or third, or Nth)
programming language isn't necessarily to perform a specific task, but
rather to learn how to program. A competent programmer can learn new
languages for specific tasks as required, because he or she already
knows how to program. The best languages for learning how to program
aren't those, like PHP or AS3, designed to solve a specific problem,
like building web applications. Focusing on a specific problem domain
is great for learning how to solve that single kind of problem, not so
great for other things.
  
I have interpreted the original question as Do I need to learn 
language X to become an AS3 programmer and the answer is most 
definitely No. There's no harm (and much to be gained) in learning 
subsequent languages once the principle concepts are grasped with the 
first language. What is a mistake is to try and learn two new 
languages at the same time and it would also be misleading to say that 
learning another language is a prerequisite for learning AS3.

As a ColdFusion developer, I see the same sort of thing all the time.
People learn how to write ColdFusion, as it's very easy, but they
develop a tunnel vision of sorts, and they don't understand a lot of
things about programming in general (like concurrency) because it's
not an issue in that language.
  
I understand that view completely. I have a Computer Science degree 
and spent several years working on writing operating systems and 
low-level disk controllers. Many of the people I have worked with have 
grown up in a specific development environment and don't stray beyond 
it. They are sometimes rather surprised if I use a technique that is 
used in OS synchronisation.


You mention concurrency and that is something Adobe needs to address 
(I'm sure it won't be easy to make the Flash infrastructure thread 
safe) and we both know that it will improve performance greatly in the 
player where there are multiple cores available. I'm sure it will also 
swell the posting on flashcoders!


Currently it's necessary for developers to know Actionscript for Flash 
and Flex plus something else for server interaction. I'd rather see 
the second language being useful to allow people to complete their 
pipeline to the server than be a language that may not suit that well. 
It's also important in these economic climes, that the effort put in 
suits the market demand for expertise. It's unfortunate in some ways 
that Adobe haven't pushed the boat a little further with a good 
server-side actionscript implementation to make that access to data 
even easier.


I used to develop in a proprietary environment with some similarities 
to Flash/Actionscript and used to 

Re: [Flashcoders] DSL - Standard Consumer K / Sec?

2009-08-31 Thread Ron Wheeler


www.dslreports.com would be a good place to start to look for statistics.


jared stanley wrote:

Hey all,

Looking for stats on connection speeds; looking for a 'minimum system
requirements' spec for connection...what would be an 'average' DSL
connection?

I have Charles proxy open and throttling the connection to test this
flash site, wondering what is the lowest common denominator to test
with?

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

  


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


Re: [Flashcoders] mac vs pc

2009-08-18 Thread Ron Wheeler

You might look at Spring Roo to see where the generation of code is going.
It is very slick. It works very nicely from the UML model.

Document the classes and atomic properties.
Document the relationships. Order has a property which is a set of 
Order Details and Order Details has a reference to an Order
Document the finders I want a findByOder on OrderDetails, I want a 
findByCustomer on Order It can tell from the names what you want.

Document the names of the controllers you want created.
Document the controllers for which you want automatic test scripts.
request that Security be added

Feed your little script into Roo and you get a working Java webapp with 
CRUD for all your objects.


Import that into Eclipse (STS version) and customize it.

Still learning how to use it but it is pretty slick. The visual 
appearance is horrible but it is set up for CSS so it can be fixed up.
All of the CRUD functions are on a single page, so you do have to go in 
and remap your content, menus and functions onto URLs and pages that 
make sense.


It depends on Spring and AOP very heavily. The code generated is very, 
very concise and readable.


I am just getting used to AOP and it looks pretty intimidating.

If we only had Spring for haXe..


Ron

Matt Gitchell wrote:

I figured this is where we'd end up.
I code in either environment with comparable speed, honestly, it's just
getting used to the workflow.
Honest! Now whether that means I code like the freakin' wind in either
or am slow as hell
in both I'll leave for you to decide. Rather than seeing the Eclipse-based
methodology as 'stupid,' I decided to consider it merely different and have
done some tweaks to get it the way I like it, which now I do.

And yes, I do 'think ahead' plenty, but that still doesn't mean that things
don't get moved around all that often. In my particular freelance world, I
end up dealing with 3rd party IT and backend guys and gals, subcontractors
of varying skill, clients who want to change scope, clients who DO change
scope (though they generally get punished financially), the gamut. Some of
these experiences mean changes of plans, which means that the refactoring
aspect is handy and saves me time.

The debug stuff is also very handy. I write code, compile, test; I
repeat this until I have a project done, for the most part. That means
that I engage the debugger more than just occasionally, I really like
having that data there.

I like these additional features, and it's worth the money to me to have
them all part of the same tool. If it saves me, say, 10 hours over the
course of owning the software, I've more than paid for it, and I've more
than paid for it.

Some of us get to work in worlds where we define all variables at the outset
of the project. We then see our projects built exactly to the class diagrams
we built when we set out to start, and we don't deviate. We then get to
write thousands of lines of perfect code, with perfect structure, then
compile it once and find that we've removed every listener, destroyed every
bitmap, caught every error, forseen every use case.

I am not one of those people, so I've bought a tool (and use a platform)
that helps compensate for that.

--Matt


On Mon, Aug 17, 2009 at 7:21 PM, Steven Sacks flash...@stevensacks.netwrote:

  

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



___
Flashcoders mailing list

Re: [Flashcoders] mac vs pc

2009-08-18 Thread Ron Wheeler

Dave Watts wrote:

What's an atomic property?



A property that is a primitive type (string, int, Boolean, etc), I think.

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

  

That is what I was trying to convey.
Thanks
Ron

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


Re: [Flashcoders] mac vs pc

2009-08-18 Thread Ron Wheeler

Merrill, Jason wrote:

Why not just call it a primitive then?

  

That would have been exactly the right thing to say/write.
Sorry.
Couldn't think of the right word at the time. Just getting old, I guess.
Ron

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 






-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Dave
Watts
Sent: Tuesday, August 18, 2009 11:22 AM
To: Flash Coders List
Subject: Re: [Flashcoders] mac vs pc

  

What's an atomic property?



A property that is a primitive type (string, int, Boolean, etc), I
think.

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] project planning tools

2009-07-18 Thread Ron Wheeler

Benny wrote:

I am looking for tips/experiences for a simple/intuitive and affordable gantt 
based (offline) planning tool which should run on Windows vista.

Which tools are you using to plan your Flash projects and why would you 
recommend it?



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

  

http://www.serena.com/products/openproj/index.html
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Flash use a proxy for sockets.

2009-06-30 Thread Ron Wheeler
The usual way to solve this is to set the firewall to NAT the port to 
the server behind the firewall and have flash connect to the firewall on 
the NATed port.  In a made up case, NATing port 2980 on the firewall's 
ethernet 0 at 200.200.200.1 to  port 2980 on the server 192.168.1.7 on 
the firewall's ethernet 1 interface, causes access to public address 
200.200.200.1 port 2980 to be transparently remapped to 192.168.1.7:2980 
on the private net attached to the firewall.


If you have public addresses behind the firewall, you could do the NAT 
on one of these servers.


This is common. I use it to access administrative ports(eg SSH) on 
servers that are on private 192.168.x.x  or 10.x.x.x subnets that can 
not be used on the Internet.


Ron


Glen Pike wrote:

Hi,

   We have a system of distributed systems that use Flash to control 
various parts by sending commands over a socket.


   The problem is that these systems sit behind a firewall that only 
allows access from a specific IP address - our work offices...
   We want to be able to connect to these systems from the outside 
world - they also serve their Flash via a webserver so I set up a 
proxy on our office to allow us to connect to the webservers.


   The problem is that Flash Player does not use the proxy server for 
socket connections - it connects directly to the IP address derived 
from the URL of the SWF.  Is there any way I can make Flash use a 
proxy server for this???


   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] anti-aliasing

2009-05-18 Thread Ron Wheeler

You are on the right list.

To get some help, you will probably have to give more details.
- 2D or 3D
- vectors or rasters - images or drawings
- what kind of shapes
- dynamic or static
- data driven or algorithmic
- user interaction desired
- low-res icons or sprites for a game or beautifully rendered images 
suitable for printing


Google is also your friend.

Ron


Anthony Pace wrote:

Hello,

I am trying to draw shapes using pixel manipulation, and I am pretty 
sure I understand most of the concepts; yet, as I am pretty new to 
this, I am unsure how to go about doing this most efficiently in code.


Does anyone have any links, tutorials, commented code? Are there tried 
and true formulae I should be using that you may know of? or should I 
just look at converting a library from another language because there 
is no point reinventing the wheel because the best formulae have been 
found? should I be discussing this on a different list?


Thanks,
Anthony
___
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] Multiplying a Vector3D by a projection Matrix3D

2009-05-07 Thread Ron Wheeler

Fumio Nonaka wrote:

Vector3D.project() method in [Help] says:
If the current Vector3D object is the result of multiplying a Vector3D
object by a projection Matrix3D object, the w property can hold the
transform value.
http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/geom/Vector3D.html#project()

How can you multiply a Vector3D object by a projection Matrix3D object?
 I had thought the Matrix3D.transformVector() method do it.  However the
Vector3D.w property of the reslut instance did not hold its value but
was set to 1.  I could not find out other methods for multiplication.

var myMatrix3D:Matrix3D = new Matrix3D();
var myVector3D:Vector3D = new Vector3D();
trace(myVector3D, myVector3D.w);  // Output: Vector3D(0, 0, 0) 0
myVector3D = myMatrix3D.transformVector(myVector3D);
trace(myVector3D, myVector3D.w);  // Output: Vector3D(0, 0, 0) 1

Any advices or suggestions would be very appreciated.
  
I am not an expert on matrix multiplication (was much better at it 40 
years ago), so you can take my comments with a grain of salt.


You seem to be multiplying a null vector(zero length located at 0,0,0 at 
the best interpretation) by a null or zero transformation. The results 
will not be very interesting .


Perhaps you might try it with a not null vector and a not null 
transformation and see if you get something more interesting.


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


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

2009-04-24 Thread Ron Wheeler

Dave Watts wrote:

One of the possible tricks that you can use, is to send messages to your
high-score server during the game so that you can verify that the person
passed certain checkpoints. You can throw these away after the final score
is recorded and validated.
At the checkpoints, you can record current score, a game state(if that is
relevant)  and a timestamp and then do a quick reasonableness check when the
final score is recorded.

You need to assume that the cheater has read your client-side code.
A determined cheater can always build a simulator for your game and replace
your game with their simulator.



Keep in mind that all communication between the client and the server
can be recorded by the client (or the server for that matter, not that
that would be a threat). So, those messages could also be recorded.
SSL/TLS will not prevent this, either - it'll simply mean that the
communication can only be recorded by the client or server endpoints,
and nothing in between.
  
You do have the element of time in the recording so that the user has to 
get the right messages at the right time which means that they have to 
record a winning high score to produce a fake high score and may be 
unable to produce a higher score since they have no path through the 
game to copy.


The realistic goal of security is never absolute protection. You just 
want to make the cost higher than the hacker is willing to pay to get 
the result.
Of course, no one would turn down a scheme that gave absolute security 
but those are few and far between.



The crossdomain file gives you some protection.



That doesn't protect the server, only the client's machine.

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] Feasibility of xml file for high score data storage

2009-04-24 Thread Ron Wheeler

Paul Steven wrote:

Thanks Ron - that is another great idea. So I guess I could send a message
after each level with the time elapsed and score at this point - then check
at the end if all level messages have been received.
  

And that sufficient time has elapsed.

I think my clients main concern with regards hacking was related to hackers
being able to inject malicious code via my PHP/MYSQL code which could affect
other elements on their server apart from the game.

  

A good audit by a security consultant or independent PHP expert might help.
They could also use and http proxy (Apache mod_proxy) and put your 
application on its own server or virtual server with its own MySQL for 
added security.


Ron

Cheers

Paul

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Ron Wheeler
Sent: 23 April 2009 21:02
To: Flash Coders List
Subject: Re: [Flashcoders] Feasibility of xml file for high score data
storage

One of the possible tricks that you can use, is to send messages to your 
high-score server during the game so that you can verify that the 
person passed certain checkpoints. You can throw these away after the 
final score is recorded and validated.
At the checkpoints, you can record current score, a game state(if that 
is relevant)  and a timestamp and then do a quick reasonableness check 
when the final score is recorded.


You need to assume that the cheater has read your client-side code.
A determined cheater can always build a simulator for your game and 
replace your game with their simulator.


The crossdomain file gives you some protection.

Ron


Paul Steven wrote:
  

Thanks jonathan - that is very useful to know. I am now going to


incorporate
  

some security anyway as the client wants it to be hacker-proof :)

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of jonathan
howe
Sent: 23 April 2009 15:10
To: Flash Coders List
Subject: Re: [Flashcoders] Feasibility of xml file for high score data
storage

I've done several games with relatively open high score systems. There was
no prize for winning, and people cheated within the first 2 hours of


launch.
  

Don't assume they wont! Especially if the score chart posts usernames.

On Thu, Apr 23, 2009 at 4:38 AM, Paul Steven
paul_ste...@btinternet.comwrote:

  


Ah I see - thanks Glen.

For this particular project, there would be very little benefit in

  

cheating
  


as there is no prize. However it certainly sounds like something I will

  

use
  


on my other game projects.

Thanks for your time writing out the explanation.

Cheers

Paul

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen Pike
 Sent: 22 April 2009 15:27
To: Flash Coders List
Subject: Re: [Flashcoders] Feasibility of xml file for high score data
storage

Hi,

   The public / private key thing is just about encrypting some of
the score data that you pass to the server to stop people cheating your
high score tables.

   for example, if your high score system in PHP uses a GET / POST
something like this:

   scores.php?name=Glenscore=500

   It's easy for me to cheat...

   But if you do (pseudo code):

   var key:String = mysecretkey;

   var encrypted:String = MyEncryptClass.encrypt(name=Glenscore=500,
key);

   var result:Boolean = MyServer.sendScore(encrypted);

   And it does something like this:

   scores.php?command=submitencrypted=asdiou23q890czoued9auc0

   You can then use the server key to decrypt your message.

   (Public  Private keys are about asymmetrical encryption)

   Anyway, the idea is to make it harder for people to cheat - as the
data is not very sensitive, you can go for a simple encryption option
where you store the key in the SWF, which means that people can still
decompile your Flash file and find out the key, but only the most
dedicated of cheaters would do that...

   If you really want to go to town, you are probably going to have to
create some kind of login for people to play the game / submit high
scores, but to be honest, you can just go for simple score encryption -
look at Jobe's stuff again - if your game does not have any kind of
prize...


   You can get some AS3 / AS2 code that handles encryption which can be
decrypted with functions in PHP. I have some links at home I can post
later if you like..

   Glen

Paul Steven wrote:

  

Thanks for the reply Anthony.

Can you elaborate on the public private key system and what this
  


entails?
  


I

  

have not heard that term before.

Thanks

Paul

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


Pace

  

Sent: 22 April 2009 14

[Flashcoders] TextBox not wraping properly

2009-04-24 Thread Ron Wheeler

This seems to be an old bug that still has not been fixed.

If you have a textbox with wordwrap on, it breaks a hyphenated word such 
as decision-maker as

decision
-maker

Seems a pretty stupid choice, at least for English.

Has anyone found a fix for this?

Ron


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


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

2009-04-23 Thread Ron Wheeler
One of the possible tricks that you can use, is to send messages to your 
high-score server during the game so that you can verify that the 
person passed certain checkpoints. You can throw these away after the 
final score is recorded and validated.
At the checkpoints, you can record current score, a game state(if that 
is relevant)  and a timestamp and then do a quick reasonableness check 
when the final score is recorded.


You need to assume that the cheater has read your client-side code.
A determined cheater can always build a simulator for your game and 
replace your game with their simulator.


The crossdomain file gives you some protection.

Ron


Paul Steven wrote:

Thanks jonathan - that is very useful to know. I am now going to incorporate
some security anyway as the client wants it to be hacker-proof :)

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of jonathan
howe
Sent: 23 April 2009 15:10
To: Flash Coders List
Subject: Re: [Flashcoders] Feasibility of xml file for high score data
storage

I've done several games with relatively open high score systems. There was
no prize for winning, and people cheated within the first 2 hours of launch.
Don't assume they wont! Especially if the score chart posts usernames.

On Thu, Apr 23, 2009 at 4:38 AM, Paul Steven
paul_ste...@btinternet.comwrote:

  

Ah I see - thanks Glen.

For this particular project, there would be very little benefit in


cheating
  

as there is no prize. However it certainly sounds like something I will


use
  

on my other game projects.

Thanks for your time writing out the explanation.

Cheers

Paul

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen Pike
 Sent: 22 April 2009 15:27
To: Flash Coders List
Subject: Re: [Flashcoders] Feasibility of xml file for high score data
storage

Hi,

   The public / private key thing is just about encrypting some of
the score data that you pass to the server to stop people cheating your
high score tables.

   for example, if your high score system in PHP uses a GET / POST
something like this:

   scores.php?name=Glenscore=500

   It's easy for me to cheat...

   But if you do (pseudo code):

   var key:String = mysecretkey;

   var encrypted:String = MyEncryptClass.encrypt(name=Glenscore=500,
key);

   var result:Boolean = MyServer.sendScore(encrypted);

   And it does something like this:

   scores.php?command=submitencrypted=asdiou23q890czoued9auc0

   You can then use the server key to decrypt your message.

   (Public  Private keys are about asymmetrical encryption)

   Anyway, the idea is to make it harder for people to cheat - as the
data is not very sensitive, you can go for a simple encryption option
where you store the key in the SWF, which means that people can still
decompile your Flash file and find out the key, but only the most
dedicated of cheaters would do that...

   If you really want to go to town, you are probably going to have to
create some kind of login for people to play the game / submit high
scores, but to be honest, you can just go for simple score encryption -
look at Jobe's stuff again - if your game does not have any kind of
prize...


   You can get some AS3 / AS2 code that handles encryption which can be
decrypted with functions in PHP. I have some links at home I can post
later if you like..

   Glen

Paul Steven wrote:


Thanks for the reply Anthony.

Can you elaborate on the public private key system and what this
  

entails?
  

I


have not heard that term before.

Thanks

Paul

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

Pace


Sent: 22 April 2009 14:25
To: Flash Coders List
Subject: Re: [Flashcoders] Feasibility of xml file for high score data
storage

Hello Paul,

Making good use of a que would be required for writing to the file
without errors, so a database is the best and easiest way; as well, for
high scores, you might want to use a public private key system for
preventing xss exploits, as anyone that knows how to intercept and edit
the get or post data will be able to screw with the request to the
server, and you could end up with a hundred people having the best score
that the column in the DB will allow.

Take care,
Anthony

Glen Pike wrote:

  

Not working for Cornwall County Council by any chance??? :)

Paul Steven wrote:



Thanks Glen and Ian

Yes I am currently using a mysql database while the high scores are
hosted
on my site. The game is for a rather large organisation so it is not
  

the


easiest task in the world getting a database set up at their end. The
mention of flash alone was enough to cause major panic so you can
imagine
the fear when I mentioned the need to upload php files to their
 

Re: [Flashcoders] design pattern diagrams...

2009-01-07 Thread Ron Wheeler
Head First Design Patterns is very easy to pick up. No typos, lots and 
lots of pictures, illustrations and code examples.

http://oreilly.com/catalog/9780596007126/?CMP=AFC-ak_bookATT=Head+First+Design+Patterns

http://www.headfirstlabs.com/books/hfdp/ for a quick overview and a 
typical illustration


http://oreilly.com/catalog/9780596007126/toc.pdf  Read the section on 
the Observer Pattern. It might be what you are looking for.


Merrill, Jason wrote:

I think just a quick answer to your questions which may help a lot is to check 
into understanding MVC - the Model-View-Controller design pattern.  Probably 
one of the most common pattern used and one that other coding design frameworks 
use as well for part of their operations.

So there are also frameworks like Cairngorm which takes MVC and other patterns 
together and go a lot further, it has things like Commands to facilitate 
communication.  But simple MVC using event listeners and dispatchers is 
probably the best place to start to get what you want to do going.


Jason Merrill
Bank of America Instructional Technology  Media   ·   GCIB  Staff Support 
LLD

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







-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com 
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Anthony Pace
Sent: Wednesday, January 07, 2009 3:48 PM
To: Flash Coders List
Subject: [Flashcoders] design pattern diagrams...

I am looking to get more info on the composition of design patterns and 
which ones are used most often in the corporate world.


Diagrams accompanied by code examples would be awesome.  I have been 
able to find stuff in the past; yet, I really want to know what is 
generally preferred?


I like to try and make things black box; however, it just seems 
illogical that things be black boxes all the time.


when a person talks to another person the environment that they are in 
has to facilitate the communication; thus, if I have two objects 
instantiated in the same class and I want them to communicate with each 
other, I have to have a function in the main class or somewhere globally 
that allows those objects to communicate.


How do I accomplish this without calling to the function in the parent?
___
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] frameworks and flash

2008-11-17 Thread Ron Wheeler
If your framework includes dependency injection like Spring or database 
tools like Hibernate or HaXe's SPOD for the Flashplayer, then you get a 
lot of your code moved into configuration files which really cuts down 
on the work, re-enforces collaboration and makes testing a lot better.

Java is way ahead in this area but perhaps we will get there.

Ron

Paul Andrews wrote:
A framework gives you amethod of organising your code in a manner that 
aids development and maintenance. Using a framework makes your code 
organisation understandable to others that are familiar with the 
framework, so it aids cooperative/team development. Potentially you 
can work on other projects that use the same or similar framework more 
easily and maybe pick up some coding guidelines/shortcuts and 
understand the strategies followed by others.


In tiny projects frameworks aren't too important. In larger 
co-operative projects it is important for the reasons above.


Paul
- Original Message - From: Joel Stransky 
[EMAIL PROTECTED]

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Saturday, November 15, 2008 5:00 PM
Subject: Re: [Flashcoders] frameworks and flash



@ekameleon, that seems a little intense for me atm. This discussion is
mainly about weather or not it's just dumb not to use a framework vs. 
plain

as3 when building common flash sites. I'm looking to hear things like,
PureMVC makes everything easier. or It makes no sense not to use 
Mate.


On Sat, Nov 15, 2008 at 2:42 AM, Hans Wichman 
[EMAIL PROTECTED] wrote:


Read the article, some good, some bad.
If anyone declares you for a fool if you prefix interfaces with 'I'
and use marker interface, I tend to gloss over the rest of the article
since it no longer comes across trustworthy... Personal preference
aside:)

On Sat, Nov 15, 2008 at 12:05 AM, David Hershberger
[EMAIL PROTECTED] wrote:
 Haha!  Before you try Cairngorm, check out this article:


http://blog.iconara.net/2008/04/13/architectural-atrocities-part-x-cairngorms-model-locator-pattern/ 



 Having used Cairngorm for a while now I have to agree with him.  The
article
 is pretty harsh, and it only talks about the ModelLocator part.

 Dave

 On 11/14/08, Joel Stransky [EMAIL PROTECTED] wrote:

 Thanks for the post Dave. Cairngorm sounds a lot like PureMVC 
which  does
 away with events and implements a global command structure. So 
far  it's
 appealing although my first run in with it was under bad 
conditions. A
 client of a friend had mangled it something fierce before he was 
 brought

in
 at which point he brought me in to implement deep linking. It was 
ugly

to
 say the least. I have however heard great things about it since 
then.  My

 gut
 says I should know how to do this stuff on my own before I go 
relying

too
 heavily on tools that prevent me from getting to know the inner 
 workings

 intimately.

 It's just tough to esitmate flash/flex work effictively anymore 
 without

a
 framework involved it seems. Clients don't have the time or 
budget for

 builds from scratch. Flash used to be so fun but now it's a constant
 learning curve. ugg.

 Interestingly enough I looked up the cairngorm site and saw a 
link to

this
 blog post made just yesterday:
 http://www.anandvardhan.com/2008/11/13/popular-flex-frameworks/

 This should also be informative.
 http://www.insideria.com/2008/11/new-poll-which-flex-framework.html



 On Fri, Nov 14, 2008 at 1:52 PM, David Hershberger 
[EMAIL PROTECTED]
 wrote:


  We have been using Adobe Flex for the past year and have really 
  liked

it.
  It would be hard to call it blazing and bloat does seem 
like it

might
  apply to some extent, but on the other hand it does so many nice
things
 for
  us it is hard to argue with.  MXML is very powerful, but there is
 certainly
  a big learning curve.  For basic stuff, buttons and containers and
text,
  it's easy to get started.  There are lots of subtle details 
though,   so

 when
  you start wanting to do things in ways the Flex authors didn't
anticipate
  it
  often takes experimentation to find a way that works.  The Flex
framework
  code is open source at least, so you can always dig into that 
and   see

 what
  it's doing.
 
  We have also used Cairngorm, with mixed results.  Cairngorm 
doesn't

 really
  give you much code, it is mostly a set of design patterns.  
Some of

the
  important code it does give is a controller which connects  
 Cairngorm
  Events to Cairngorm Commands.  Cairngorm events inherently know 
  their
  dispatcher, which is a singleton, so you can just fire off 
events   like

 so:
new SaveGameEvent(game, user).dispatch();
  and the controller connects that to the appropriate
 SaveGameCommand.  We've
  come to the conclusion that Cairngorm is great for situations 
where

most
  user actions imply immediate communications with a server, but 
not   so

  useful
  for situations where user actions are just manipulating data  
 internal

to
  the
  .swf.  We have ended 

Re: [Flashcoders] favourite programming environment

2008-09-27 Thread Ron Wheeler

Eclipse with HAXE

Ron

Allandt Bik-Elliott (Receptacle) wrote:
I'm sure it's been asked before but as these things change over time, 
i thought it worth rehashing now


what's your favourite coding environment?

I really like FlashDevelop but because I'm on a mac, I've been looking 
into other options (although FD with parallels is a pretty good 
setup). I've found eclipse and FDT to be shaky at best - the AS2 
libraries are incomplete (the mx lib has to be added to the default 
setup, for instance) and it seems to be a little unstable (if it 
doesn't crash entirely once in a while, it seems to get slower over 
time - maybe there's a memory leak somewhere?) and FDT costs an 
astronomical amount for something that is supposed to go alongside the 
Flash IDE when doing AS2 (which seems to be still the most widely used 
version of Actionscript outside of full-on microsite design) as it 
doesn't have it's own AS2 compiler.


I've seen that coda has started supporting AS code hinting but without 
real OOP class support, it really only is a curio at the moment.


what do you guys think?

thanks
allandt

___
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: generating arrays of overlapping sets

2008-09-11 Thread Ron Wheeler

Wouldn't this be a whole lot easier if you used objects?
I am coming to the conclusion - not a great theoretical concept or 
exhaustive examination of 6+ years of flashcoders posts - that most 
forum questions that mention arrays of arrays would be a lot easier to 
solve if the questioner had an array of objects.


Most questions would never have got to the point of needing help.

I suggest giving it a moments thought at least.


Ron



sebastian wrote:
ok I found a solution, though it was more of a work-around than a 
direct resolution of the array comparing routine I was working towards.


My solution is to add to a master array all the sub arrays that it 
finds, and adds them only if unique. I then have a list of all the 
sub-arrays together in one long 2D array. From this array I can then 
sort it based on the length of the second element. Then I iterate from 
the smallest sub array to the largest; but I don't need to do the 
entire array because by starting small I capture the actual shapes. 
Still need to refine how to calculate the maximum steps I need to 
iterate through the master array, but it will always be at least 
length-1.


Maybe this was interesting to someone...
:P

Sebastian.

sebastian wrote:

in case it was not clear, I have no problem getting to this point:

A = [A,B,C]
B = [A,B,C]
C = [A,B,C,D,E]
D = [C,D,E]
E = [C,D,E]

where I am stumped is making that into:

A = [A,B,C]
B = [A,B,C]
C = [[A,B,C],[C,D,E]]
D = [C,D,E]
E = [C,D,E]



:)
seb.

sebastian wrote:

Hiya,

I'm trying to figure out a way to code my trigonometry so that 
collections of points are correctly associated with the right 
geometric objects. These objects are created dynamically [randomly] 
at run time so I can't know which points belong to which geometric 
shape.


Where I am scratching my head is with the following,

I have 5 points:

A,B,C,D,E

These 5 points all have little arrays that tell them who they are 
next to [ie who they should make a shape with]:


A = [A,B,C]
B = [A,B,C]
C = [A,B,C,D,E]
D = [C,D,E]
E = [C,D,E]

My problem is, I need to break C into two arrays:

A = [A,B,C]
B = [A,B,C]
C = [[A,B,C],[C,D,E]]
D = [C,D,E]
E = [C,D,E]

Which results in 2 shapes:

[A,B,C] and [C,D,E]

And there are not always 5 points, there could be any number of 
points, less or more, so it could also get more complex like this:


A= [A,B]
B= [A,B,C,D]
C= [B,C,D,E]
D= [B,C,D,E]
E= [C,D,E,F,G,H]
F= [E,F,G,H]
G= [E,F,G,H]
H= [E,F,G,H]

In this second example, it should break into 4 different shapes/arrays:

A= [A,B]
B= [[A,B],[B,C,D]]
C= [[B,C,D],[C,D,E]]
D= [[B,C,D],[C,D,E]]
E= [[C,D,E],[E,F,G,H]]
F= [[C,D,E],[E,F,G,H]]
G= [[C,D,E],[E,F,G,H]]
H= [[C,D,E],[E,F,G,H]]

which results in these 4 shapes:

[A,B],[B,C,D],[C,D,E],[E,F,G,H]

Can anyone think of a good way [not processor heavy] for me to 
correctly create sub-arrays that match the points being generated? 
The only way I can think of is doing some complex array compares, by 
building arrays from arrays of other arrays... but that seems 
convoluted...?


Thank you so much,

Sebastian.




___
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] A Question that I've been asking for years!!

2008-09-11 Thread Ron Wheeler

Second the recommendation.
Great book - applies to ActionScript easily.

Ron


Steven Loe wrote:
Check out Head First Design Pattens (oreilly). It's an easy to comprehend book on patterns and software design goodness. The book examples are in Java, so if you can read AS3 you'll be able to read sample code. 


It a great resource to learn not only what interfaces are, but why and when you 
want to use them. IMO its made EAS3 *much* easier going. Moock's interface / 
pattern explanations make much more sense after spending some time with Head 
First Design Pattens.


-Steven Loe



  

This could seem weird...
But what the hell is an interface!!! I've
  

read lots of books
and


posts without getting the answer. I bought
  

Essential AS3 to read
about


interfaces and he says that helps for multi
  

inheritance. In other
places I


read that it is a deal to ensure that a
  

class has some methods and
so on.


But what is the real benefit that I can come out with
  

using
interfaces


Maybe that is stupidity or I am not smart enough to
  

get the concept
but


believe me... its is been two years now!!

Please Help!!!

--
Omar M. Fouad - Digital Emotions
http://www.omarfouad.net

This e-mail and any attachment is for authorised use
  

by the intended


recipient(s) only. It may contain proprietary
  

material, confidential


information and/or be subject to legal privilege. It
  

should not be
copied,


disclosed to, retained or used by, any other party. If
  

you are not an


intended recipient then please promptly delete this
  

e-mail and any


attachment and all copies and inform the sender. Thank
  

you.


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com

  

http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___

Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
___
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] Drawing an arc with curveTo

2008-08-03 Thread Ron Wheeler

Google actionscript bezier

Lots of solutions come up.

Ron

Alias™ wrote:

Hi guys,

Can anyone point me towards some info on how to draw a proper curved
arc in actionscript using curveTo? I've seen plenty of stuff about how
to draw an arc using loads of short lines, but that isn't really going
to cut it - I need this to be efficient and look good.

I believe the crux of the matter is working out the correct coords for
the control points - is there any info on computing the curvature of a
line segment on a quadratic bezier? Has anyone cracked this?

Thanks in advance,
Alias
___
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] Drawing an arc with curveTo

2008-08-03 Thread Ron Wheeler

Try having a look at this
http://theolagendijk.wordpress.com/2006/08/18/flash-drawing-api-bezier/

Never used it but it looks well thought out.

Ron
Alias™ wrote:

Hi guys,

Can anyone point me towards some info on how to draw a proper curved
arc in actionscript using curveTo? I've seen plenty of stuff about how
to draw an arc using loads of short lines, but that isn't really going
to cut it - I need this to be efficient and look good.

I believe the crux of the matter is working out the correct coords for
the control points - is there any info on computing the curvature of a
line segment on a quadratic bezier? Has anyone cracked this?

Thanks in advance,
Alias
___
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] Random numbers list

2008-07-29 Thread Ron Wheeler
If you do not care if the sequences repeat, you could fill an array with 
the numbers from 1 to 100 arranged in a random order.



When you want to grab 10, just pick a random integer between 0 and 89 
and grab the block of 10 numbers following that point.
This would charge a penalty once when you loaded the 100 but your 
refresh of the 10 would be very fast.


You could have a counter on the array of 100 and every so often (after 
10-50 blocks of 10 used) regenerate the sequence of 100 if you want to 
avoid repeating the same sequence.


Ron


laurent wrote:


yes like:

allNumbers:Array = [ 0, 1, 2, 3, ..., 100 ];
tenNumbers:Array = [];

public function getNumberIn():void{
   var n:int = tenNumbers.splice( int( Math.random * 10 ), 1 );
   tenNumbers.push( allNumbers.splice( int( Math.random * 
allNumbers.length ), 1 ) );

   allNumbers.push( n );
}

Could be like that. ;)
L



Eduardo Barbosa a écrit :

Hi Laurent,

Your first suggestion is a very simple and clever trick i'll 
definetely keep

in mind for future situations.

However for this second variation you mean that I:

1) pick the numbers out of array 1  and splice it
2) move those numbers into array 2
3) when the length of array 1 would be 10 i would start picking the 
numbers

out of array 2 and do the inverse.

Is this what you mean?



On Mon, Jul 28, 2008 at 11:01 PM, laurent [EMAIL PROTECTED] 
wrote:


 

still it can be done like that you always keep the number of numbers
between two arrays...
and swap numbers from one to another, that your sure to neve have 
twice the

same one
yeah...! :]
L

Eduardo Barbosa a écrit :

  

Hi all!


What I am trying to figure out is this:

How to generate a sequence of random numbers where the newest is 
always

different from all the previous?

I need to continuosly rewrite an array of 10 random numbers in 
such a way

that at any given time they are all different.

Let's say that my range is 0 to 100

it starts with random numbers, all different:

{3, 34, 12, 69, 6, 44, 31, 90, 88, 23}

at a set interval some values are replaced by new ones so there 
are never

two equal numbers, so, after 2 seconds it may look like this:

{3, 66, 12, 79, 6, 44, 10, 81, 88, 23}


Any ideas?

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


__ Information from ESET NOD32 Antivirus, version of virus
signature database 3257 (20080710) __

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


__ Information from ESET NOD32 Antivirus, version of virus 
signature database 3257 (20080710) __


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


__ Information from ESET NOD32 Antivirus, version of virus 
signature database 3257 (20080710) __


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] Is a precise timer for making rhythms possible?

2008-07-14 Thread Ron Wheeler

Eric E. Dolecki wrote:

I think he means a prior composition


No. I mean the one just generated.
Ron


Sent from my iPod

On Jul 12, 2008, at 3:55 PM, Kerry Thompson 
[EMAIL PROTECTED] wrote:



Ron Wheeler wrote:


If you have a playback button that plays the composed work, you can
concatenate the sounds/notes selected and play the composed segment.


That's interesting--can that be done at runtime? How can you 
concatenate the sounds?


Cordially,

Kerry Thompson


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

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



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


Re: [Flashcoders] Is a precise timer for making rhythms possible?

2008-07-14 Thread Ron Wheeler

I would do it on the server side.

Since you are using a stable set of notes, you could have a duplicate 
set on the server and have the Flash Player send the list that you want 
assembled and the server could return an MP3.


You could also have the server save the sequence for later examination 
or replay.

Looking more like MIDI by the day. Put a MIDI player on the server.

There are probably ways to do it on the client as well.

Ron

Kerry Thompson wrote:

Ron Wheeler wrote:

  

If you have a playback button that plays the composed work, you can
concatenate the sounds/notes selected and play the composed segment.



That's interesting--can that be done at runtime? How can you concatenate the 
sounds?

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] Is a precise timer for making rhythms possible?

2008-07-14 Thread Ron Wheeler

Abe Pazos wrote:

In my case there is a strong interactive part, and there is not
enough time to send user interaction data to the server and
then render the sound. And we have thousands of simultaneous
users, so it's too much load for any cpu.
It should not take long to render and thousands of users simultaneously 
wanting to compose a song sounds like a rather interesting application 
with a huge market and lots of ways to get funds.
I doubt if it will get bigger than Google or MSN so I would not worry 
about the server side stuff very much. If you actually do get to 1000 
simultaneous users (implies several tens of thousands of clients) you 
will likely store the MP3 notes in memory and build the composition 
right into the HTTP server's response stream on a number of load 
balanced parallel servers.


Anyways I know there is client side sound generation, like the
found in http://code.google.com/p/popforge/ or
http://8bitboy.popforge.de/ or all examples from Andre Michelle.
Looks interesting and from the short description, pretty much what you 
are looking for.


Maybe I try that in the future. Then the sound will probably
have no glitches. I wonder about how well would be graphics
synchronized to the sound though...
If you are playing a sound file, the trick is to synchronize the 
graphics to the sound. Watch the sound file progress and orchestrate the 
graphics to match the sound's progress.
We do this all the time in our eLearning delivery application that 
synchronizes on-screen actions with the narration. If something 
graphical is supposed to happen at 10.25 seconds into the sound file, 
then trigger it at that time.
If you are doing timeline graphics then you need to watch the timeline 
and keep it in synch.


It is less obvious to the user if you miss the timing on a visual event 
than if you screw up the playing of music. That is why I originally 
suggested the construction of a single sound file rather than trying to 
deliver a note on schedule.


Ron





Ron Wheeler wrote:

I would do it on the server side.

Since you are using a stable set of notes, you could have a duplicate 
set on the server and have the Flash Player send the list that you 
want assembled and the server could return an MP3.


You could also have the server save the sequence for later 
examination or replay.

Looking more like MIDI by the day. Put a MIDI player on the server.

There are probably ways to do it on the client as well.

Ron

Kerry Thompson wrote:

Ron Wheeler wrote:

 

If you have a playback button that plays the composed work, you can
concatenate the sounds/notes selected and play the composed segment.



That's interesting--can that be done at runtime? How can you 
concatenate the sounds?


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] Is a precise timer for making rhythms possible?

2008-07-14 Thread Ron Wheeler

Kerry Thompson wrote:

Ron Wheeler wrote:

  

It is less obvious to the user if you miss the timing on a visual event
than if you screw up the playing of music. 



You're probably right on that most of the time--that's why video will choose to 
drop a frame to keep in synch. It's also why voice-over for foreign-language 
films works.

I think Abe's application is an exception. From what I understand, he doesn't 
need millisecond-accurate timing, but his audio does need to be in synch with 
the visual events. In my case, I don't need timing so much as the ability to 
play sounds in sequence with no perceptible pause--even a few milliseconds to 
start an MP3 spoils the effect I need. That's why I was interested in your idea 
of concatenation.

  

That is why I originally
suggested the construction of a single sound file rather than trying to
deliver a note on schedule.



Makes sense--the timer in Flash is undependable, as Abe has noted. It can be 
off by several milliseconds. I.e., you can set a timer to fire every 45 ms, and 
it often fires late--up to 10 ms late, I've found.

It's easy to understand why. If you have several programs running, or have a 
download or upload running in the background, Flash simply may not have the 
CPU's attention when it needs to fire.

Your solution of concatenating on the server is cool. For my application, like 
Abe's, I have to have real-time playback, though, and can't wait for the server 
to respond. Sigh.
  


The in-memory concatenation looks good if it can be done in AS2 as well 
as AS3.
I wonder if HaXe might be a better solution. It might give a better 
outcome with less code and code that is more maintainable.



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] Is a precise timer for making rhythms possible?

2008-07-14 Thread Ron Wheeler

Kerry Thompson wrote:

Ron Wheeler wrote:
 
  

The in-memory concatenation looks good if it can be done in AS2 as well
as AS3.



I agree. Do you know of a way of doing it? I have a Playlist class that plays 
the sounds you choose, one after another, but I don't know of a way of 
concatenating them like you would a string.

  
The Sound object discussed in http://code.google.com/p/popforge/ looked 
promising.

I wonder if HaXe might be a better solution. It might give a better
outcome with less code and code that is more maintainable.



I'll look into that--I've heard many good things about it. This is a Flex 
project, though, with .swf assets, and it's already in beta--too late to change 
now.

  
We just took our AS2 core code and swf's and tied it together with Haxe 
to make a Flash RIA and it worked fine. We will migrate the last of the 
AS2 to Haxe as we re-engineer the package.



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] Is a precise timer for making rhythms possible?

2008-07-12 Thread Ron Wheeler


If the composer is playing as notes are entered, timing is not an issue. 
Fancy electric organ for the typest :-)


If you have a playback button that plays the composed work, you can 
concatenate the sounds/notes selected and play the composed segment.


Ron

Abe Pazos wrote:

I guess this is meant for Kerry? I think he IS playing songs in a sequence. 
Maybe he needs to synchronize graphic elements to the starting of parts?

In my case, I've built a composer tool and the order is not predefined, 
actually is ever changing, so I can't merge the sounds.

  
Why not just concatenate the mp3 files into 1 file and play it as a 
single sound track?


Ron

Abe Pazos wrote:

I don't understand how MP3 can take longer to start. Isn't the AIFF 
  

converted to MP3 anyways by the IDE?

I'm preloading the MP3s from disk. I have generated them myself, so they are 
  
trimmed until the last sample. Is there something that causes random delays 
when starting MP3s?

To test the SOUND_COMPLETE event, I have created a very short sample (about 
  
1 ms long) which acts as a metronome. I count when it has played 5 times, I 
play a bass drum. The timing I get is quite random. So I don't understand how 
do you get such perfect timing with your playlist class. Or maybe the problem 
is that I'm looking for much more precision than what you needed for the 
music...


Here is my test code:

var pCounter:int = 5;
var pMetro:Sound = new metronome(); // 1 ms sample to act as a timer
var pChannel:SoundChannel = pMetro.play();
pChannel.addEventListener(Event.SOUND_COMPLETE, onComplete);
var pTime:int = getTimer();
function onComplete(tEvent:Event):void {
pChannel.removeEventListener(Event.SOUND_COMPLETE, onComplete);
pChannel = pMetro.play();
pChannel.addEventListener(Event.SOUND_COMPLETE, onComplete);
trace(getTimer() - pTime);
pTime = getTimer();
if (pCounter--  0) {
return;
}
pCounter = 5;

(new BassDrum()).play();
}

These are the times traced:
107 285 48 53 55 104 59 14 42 47 57 34 47 45 45 80 15 43 47 49 47
57 33 46 47 44 84 52 69 24 100 40 72 27 63 64 26 42 44 44 73 20
44 45 47 45 54 38 48 45 57 62 21 43 46 45 49 54 35 45 45 46 67
24 47 45 46 50 53 34 45 46 105 33 45 46 46 78 26 56 23 44 106 55
45 46 45 60 38 42 42 55 58 22 46 45 47 47 48 40 47 44 48 72 18 44

For what I've read, since the sound buffer size in XP is 2048 samples,
I should be getting a stable 46 ms delay.

The problem is there with and without trace().

If I can't fix it I will just use it like it is now. Anyways it adds a 
  

less-machine more-human(drunk) like touch :)


Thanks for your reply,

Abe


  
  
As Jason mentioned, I've been going through the same process for a very 
demanding client--one of the country's best music schools. My project is to 

string together several audio clips, and make it sound like a real song, 

with 


absolutely no glitches. Here's what I've found:

- Use AS3. AS2 isn't fast enough.
- Timers have limited usability, because they can be off by several 
milliseconds. I tried that approach, and abandoned it after the prototype 
stage.
- MP3's take too long to start playing, and tend to have glitches like pops 

and clicks. A program Steven Sacks recommended, MP3Trim, helped, but still 

didn't raise it to the professional level.
- Aiff files at 44.1/16 seem to be the best solution (wav files would 

probably 


work too, but my client does all the asset prep on the Mac).

I wrote a playlist class that has methods to build a playlist and to play 

it. 

The play method simply steps through the array of sounds you have built. 

It's 

its own listener for the SOUND_COMPLETE event, and keeps playing until it 
reaches the end of the playlist.


That approach works for all but a few songs, where it's just not precise 
enough. For example, there's a pretty hyper guitar solo from American 

Idiot, 

with fast 16th notes (tempo about 128), and I needed to drop in one 

sixteenth 

note in the middle of a run. The delay was just long enough--maybe 1/100 
second--to make it sound like a hesitation. We had to drop that song from 

the 


game.

Cordially,

Kerry Thompson


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



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

  
  

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


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com

Re: [Flashcoders] Is a precise timer for making rhythms possible?

2008-07-12 Thread Ron Wheeler
This approach has the potential to be extended to merge 2 or more 
generated tracks (instruments) with some consideration of volume balance 
between the tracks.
One would concatenate the notes in each track, merge and balance the 
mp3s and play back the composite mp3 song.


Ron


Ron Wheeler wrote:


If the composer is playing as notes are entered, timing is not an 
issue. Fancy electric organ for the typest :-)


If you have a playback button that plays the composed work, you can 
concatenate the sounds/notes selected and play the composed segment.


Ron

Abe Pazos wrote:
I guess this is meant for Kerry? I think he IS playing songs in a 
sequence. Maybe he needs to synchronize graphic elements to the 
starting of parts?


In my case, I've built a composer tool and the order is not 
predefined, actually is ever changing, so I can't merge the sounds.


 
Why not just concatenate the mp3 files into 1 file and play it as a 
single sound track?


Ron

Abe Pazos wrote:
   
I don't understand how MP3 can take longer to start. Isn't the AIFF 
  

converted to MP3 anyways by the IDE?
   
I'm preloading the MP3s from disk. I have generated them myself, so 
they are   
trimmed until the last sample. Is there something that causes random 
delays when starting MP3s?
   
To test the SOUND_COMPLETE event, I have created a very short 
sample (about   
1 ms long) which acts as a metronome. I count when it has played 5 
times, I play a bass drum. The timing I get is quite random. So I 
don't understand how do you get such perfect timing with your 
playlist class. Or maybe the problem is that I'm looking for much 
more precision than what you needed for the music...
   

Here is my test code:

var pCounter:int = 5;
var pMetro:Sound = new metronome(); // 1 ms sample to act as a timer
var pChannel:SoundChannel = pMetro.play();
pChannel.addEventListener(Event.SOUND_COMPLETE, onComplete);
var pTime:int = getTimer();
function onComplete(tEvent:Event):void {
pChannel.removeEventListener(Event.SOUND_COMPLETE, onComplete);
pChannel = pMetro.play();
pChannel.addEventListener(Event.SOUND_COMPLETE, onComplete);
trace(getTimer() - pTime);
pTime = getTimer();
if (pCounter--  0) {
return;
}
pCounter = 5;

(new BassDrum()).play();

}

These are the times traced:
107 285 48 53 55 104 59 14 42 47 57 34 47 45 45 80 15 43 47 49 47
57 33 46 47 44 84 52 69 24 100 40 72 27 63 64 26 42 44 44 73 20
44 45 47 45 54 38 48 45 57 62 21 43 46 45 49 54 35 45 45 46 67
24 47 45 46 50 53 34 45 46 105 33 45 46 46 78 26 56 23 44 106 55
45 46 45 60 38 42 42 55 58 22 46 45 47 47 48 40 47 44 48 72 18 44

For what I've read, since the sound buffer size in XP is 2048 samples,
I should be getting a stable 46 ms delay.

The problem is there with and without trace().

If I can't fix it I will just use it like it is now. Anyways it 
adds a   

less-machine more-human(drunk) like touch :)
   

Thanks for your reply,

Abe


   
As Jason mentioned, I've been going through the same process for a 
very demanding client--one of the country's best music schools. My 
project is to string together several audio clips, and 
make it sound like a real song, 
with

absolutely no glitches. Here's what I've found:

- Use AS3. AS2 isn't fast enough.
- Timers have limited usability, because they can be off by 
several milliseconds. I tried that approach, and abandoned it 
after the prototype stage.
- MP3's take too long to start playing, and tend to have glitches 
like pops and clicks. A program Steven Sacks recommended, 
MP3Trim, helped, but still didn't raise it to the 
professional level.
- Aiff files at 44.1/16 seem to be the best solution (wav files 
would 
probably

work too, but my client does all the asset prep on the Mac).

I wrote a playlist class that has methods to build a playlist and 
to play 
it.
The play method simply steps through the array of sounds you have 
built. 
It's
its own listener for the SOUND_COMPLETE event, and keeps playing 
until it reaches the end of the playlist.


That approach works for all but a few songs, where it's just not 
precise enough. For example, there's a pretty hyper guitar solo 
from American 
Idiot,
with fast 16th notes (tempo about 128), and I needed to drop in 
one 
sixteenth
note in the middle of a run. The delay was just long enough--maybe 
1/100 second--to make it sound like a hesitation. We had to drop 
that song from 
the

game.

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] Is a precise timer for making rhythms possible?

2008-07-11 Thread Ron Wheeler
Why not just concatenate the mp3 files into 1 file and play it as a 
single sound track?


Ron

Abe Pazos wrote:

I don't understand how MP3 can take longer to start. Isn't the AIFF converted 
to MP3 anyways by the IDE?

I'm preloading the MP3s from disk. I have generated them myself, so they are 
trimmed until the last sample. Is there something that causes random delays 
when starting MP3s?

To test the SOUND_COMPLETE event, I have created a very short sample (about 1 
ms long) which acts as a metronome. I count when it has played 5 times, I play 
a bass drum. The timing I get is quite random. So I don't understand how do you 
get such perfect timing with your playlist class. Or maybe the problem is that 
I'm looking for much more precision than what you needed for the music...

Here is my test code:

var pCounter:int = 5;
var pMetro:Sound = new metronome(); // 1 ms sample to act as a timer
var pChannel:SoundChannel = pMetro.play();
pChannel.addEventListener(Event.SOUND_COMPLETE, onComplete);
var pTime:int = getTimer();
function onComplete(tEvent:Event):void {
pChannel.removeEventListener(Event.SOUND_COMPLETE, onComplete);
pChannel = pMetro.play();
pChannel.addEventListener(Event.SOUND_COMPLETE, onComplete);
trace(getTimer() - pTime);
pTime = getTimer();
if (pCounter--  0) {
return;
}
pCounter = 5;

(new BassDrum()).play();
}

These are the times traced:
107 285 48 53 55 104 59 14 42 47 57 34 47 45 45 80 15 43 47 49 47
57 33 46 47 44 84 52 69 24 100 40 72 27 63 64 26 42 44 44 73 20
44 45 47 45 54 38 48 45 57 62 21 43 46 45 49 54 35 45 45 46 67
24 47 45 46 50 53 34 45 46 105 33 45 46 46 78 26 56 23 44 106 55
45 46 45 60 38 42 42 55 58 22 46 45 47 47 48 40 47 44 48 72 18 44

For what I've read, since the sound buffer size in XP is 2048 samples,
I should be getting a stable 46 ms delay.

The problem is there with and without trace().

If I can't fix it I will just use it like it is now. Anyways it adds a 
less-machine more-human(drunk) like touch :)

Thanks for your reply,

Abe


  
As Jason mentioned, I've been going through the same process for a very 
demanding client--one of the country's best music schools. My project is to 
string together several audio clips, and make it sound like a real song, with 
absolutely no glitches. Here's what I've found:


- Use AS3. AS2 isn't fast enough.
- Timers have limited usability, because they can be off by several 
milliseconds. I tried that approach, and abandoned it after the prototype 
stage.
- MP3's take too long to start playing, and tend to have glitches like pops 
and clicks. A program Steven Sacks recommended, MP3Trim, helped, but still 
didn't raise it to the professional level.
- Aiff files at 44.1/16 seem to be the best solution (wav files would probably 
work too, but my client does all the asset prep on the Mac).


I wrote a playlist class that has methods to build a playlist and to play it. 
The play method simply steps through the array of sounds you have built. It's 
its own listener for the SOUND_COMPLETE event, and keeps playing until it 
reaches the end of the playlist.


That approach works for all but a few songs, where it's just not precise 
enough. For example, there's a pretty hyper guitar solo from American Idiot, 
with fast 16th notes (tempo about 128), and I needed to drop in one sixteenth 
note in the middle of a run. The delay was just long enough--maybe 1/100 
second--to make it sound like a hesitation. We had to drop that song from the 
game.


Cordially,

Kerry Thompson


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


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

  


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


Re: [Flashcoders] Is a precise timer for making rhythms possible?

2008-07-11 Thread Ron Wheeler

Isn't MIDI designed for this type of application
http://www.alexisisaac.net/products/flashMidi/

Ron

Abe Pazos wrote:

I don't understand how MP3 can take longer to start. Isn't the AIFF converted 
to MP3 anyways by the IDE?

I'm preloading the MP3s from disk. I have generated them myself, so they are 
trimmed until the last sample. Is there something that causes random delays 
when starting MP3s?

To test the SOUND_COMPLETE event, I have created a very short sample (about 1 
ms long) which acts as a metronome. I count when it has played 5 times, I play 
a bass drum. The timing I get is quite random. So I don't understand how do you 
get such perfect timing with your playlist class. Or maybe the problem is that 
I'm looking for much more precision than what you needed for the music...

Here is my test code:

var pCounter:int = 5;
var pMetro:Sound = new metronome(); // 1 ms sample to act as a timer
var pChannel:SoundChannel = pMetro.play();
pChannel.addEventListener(Event.SOUND_COMPLETE, onComplete);
var pTime:int = getTimer();
function onComplete(tEvent:Event):void {
pChannel.removeEventListener(Event.SOUND_COMPLETE, onComplete);
pChannel = pMetro.play();
pChannel.addEventListener(Event.SOUND_COMPLETE, onComplete);
trace(getTimer() - pTime);
pTime = getTimer();
if (pCounter--  0) {
return;
}
pCounter = 5;

(new BassDrum()).play();
}

These are the times traced:
107 285 48 53 55 104 59 14 42 47 57 34 47 45 45 80 15 43 47 49 47
57 33 46 47 44 84 52 69 24 100 40 72 27 63 64 26 42 44 44 73 20
44 45 47 45 54 38 48 45 57 62 21 43 46 45 49 54 35 45 45 46 67
24 47 45 46 50 53 34 45 46 105 33 45 46 46 78 26 56 23 44 106 55
45 46 45 60 38 42 42 55 58 22 46 45 47 47 48 40 47 44 48 72 18 44

For what I've read, since the sound buffer size in XP is 2048 samples,
I should be getting a stable 46 ms delay.

The problem is there with and without trace().

If I can't fix it I will just use it like it is now. Anyways it adds a 
less-machine more-human(drunk) like touch :)

Thanks for your reply,

Abe


  
As Jason mentioned, I've been going through the same process for a very 
demanding client--one of the country's best music schools. My project is to 
string together several audio clips, and make it sound like a real song, with 
absolutely no glitches. Here's what I've found:


- Use AS3. AS2 isn't fast enough.
- Timers have limited usability, because they can be off by several 
milliseconds. I tried that approach, and abandoned it after the prototype 
stage.
- MP3's take too long to start playing, and tend to have glitches like pops 
and clicks. A program Steven Sacks recommended, MP3Trim, helped, but still 
didn't raise it to the professional level.
- Aiff files at 44.1/16 seem to be the best solution (wav files would probably 
work too, but my client does all the asset prep on the Mac).


I wrote a playlist class that has methods to build a playlist and to play it. 
The play method simply steps through the array of sounds you have built. It's 
its own listener for the SOUND_COMPLETE event, and keeps playing until it 
reaches the end of the playlist.


That approach works for all but a few songs, where it's just not precise 
enough. For example, there's a pretty hyper guitar solo from American Idiot, 
with fast 16th notes (tempo about 128), and I needed to drop in one sixteenth 
note in the middle of a run. The delay was just long enough--maybe 1/100 
second--to make it sound like a hesitation. We had to drop that song from the 
game.


Cordially,

Kerry Thompson


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


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

  


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


[Flashcoders] [Script_in_Action] Re: My problem...

2007-09-16 Thread Ron Wheeler
Coding questions should be discussed on flashcoders.
This is a forum for ActionsScript resources only. It is not intended
to be a place to discuss code. Flashcoders has a much more active
community and you will get a lot of help there.

If you come across a component, framework, book or tutorial that you
think is worth sharing, add a link here.


Ron

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

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


Re: [Flashcoders] XML confusion

2007-09-10 Thread Ron Wheeler
You do not want to send an XML object, you just want to send the string. 
It is the server that needs to convert the string to an XML Object. Just 
send it the characters.
You may have to encode the string since HTTP has no idea about CDATA. 
The browser and server will look at every character inside the CDATA and 
look for things to process .


Try making it shorter.

var encodedString:String = encoded string;

var XMLString:String;   
XMLString = ?xml version=\1.0\ encoding=\UTF-8\?;
XMLString += file;
XMLString += ![CDATA[ + encoded string + ]];
XMLString += /file;

trace (XMLString =  + XMLString); // Trace 1

//Need an encode here to protect the encoded data from interpretation 
  

var scriptPath:String = uploadUrl + ?xml= +  XMLString + key= + _key +
session= + _sessionId; 


Paul Steven wrote:

I am trying to convert a string to xml but for some reason when I convert to
xml it only displays the encoded string. See below the code snippet for
what is traced. Any idea what I am doing wrong?

Here is my test file

var encodedString:String = encoded string;

var XMLString:String;   
XMLString = ?xml version=\1.0\ encoding=\UTF-8\?;
XMLString += file;
XMLString += ![CDATA[ + encoded string + ]];
XMLString += /file;

trace (XMLString =  + XMLString); // Trace 1

var dataToSend:XML = new XML(XMLString);

trace (dataToSend =  + dataToSend); // Trace 2  

var scriptPath:String = uploadUrl + ?xml= +  dataToSend + key= + _key +
session= + _sessionId; 

-
Trace Results
-
1.
XMLString = ?xml version=1.0 encoding=UTF-8?file![CDATA[encoded
string]]/file
2.
encoded string



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

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


  

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

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


Re: [Flashcoders] Flash and 3D example

2007-09-10 Thread Ron Wheeler

A few 3D pacakages.
Google Sandy 3d
http://sandy.media-box.net/blog/

Norman Cousineau wrote:

There doesn't seem to be too much Flash / 3D stuff out there.
I've posted an example of Flash and 3D working together.
I've been doing a fair amount of research into using 3D objects in training 
scenarios, and this is one example that uses Flash.

http://www.datasfaction.com/3D/


Cheers,
Norm


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

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



  

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

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


Re: [Flashcoders] FLASH CMS

2007-09-09 Thread Ron Wheeler

OpenCMs and Lenya


Claudio M. E. Bastos Iorio wrote:

I'm currently doing some research on flash CMS. The idea is to build my own
using Flash CS3. The backend will be ASP.NET(C#) and MSSQL.

 


. I have many questions, the first one is: what do you think is the
best approach? For example, suppose I need to edit some text (content) and
properties (bold). So, this text, once edited, will be a html string like
'bthis text in bold/'. Should I store this value in a database or XML
file associated with some 'template file'  OR does flash allow me to
create/generate a movie file (lets say 'movie_bold_text.swf') as a result?

. Is any CMS out there (preferably open source) that I should see?

 


I hope you guys could point me to any URL that you consider, tutorials, AS3
classes to see. TIA.   

 

 


__

Claudio M. E. Bastos Iorio

 http://www.blumer.com.ar/ http://www.blumer.com.ar

 


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

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


  

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

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


Re: [Flashcoders] General question about data management

2007-08-31 Thread Ron Wheeler

I think that you are on the right track.


Pass the XML sub-tree to the constructor to create the class. If you do 
this, then any change to the schema will only affect the class parsing 
that part of the tree.
If you do the same thing to create the XML to be saved, you will get the 
same benefit on output.


Minimize parsing at each level so that each object only knows its own 
XML structure and loads its own properties. If it sees a child it should 
call a constructor to get the child object built.


You code should be very robust and easy to maintain. A monolithic 
parsing engine that maintains a complex XML file is going to be a 
headache every step of the way.


Ron


Paul Steven wrote:

I am creating a desktop application using Flash and Zinc. The first time it
runs, it retrieves all the data by calling a series of scripts on a server.
The data is returned as xml data.

My question is, can I just store all the info in memory as xml data or do I
need to create classes to store the info?

I need to store all this data locally so that users can use the application
later even if they are not online so I was planning on writing xml files to
the users hard drive.

Basically the application stores details of examinations and the students
associated with each exam.

I am currently reading in the xml data about each exam and using an
examination class to create instances of each exam to store the properties.
Likewise I am reading in all the data for each student and using a student
class to create instances of each student to store the properties of each
student.

I am thinking that this is not necessary and that I could just read in the
xml and use this xml data whilst the application is running. Any changes
made by the user could directly change the xml data. Then when they choose
to save their work, I would write the xml data to a text file.

Any advice on this much appreciated as I am getting a bit confused and have
spent days writing classes to deal with all the data management.

Thanks

Paul

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

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


  

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

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


Re: [Flashcoders] [OT]Server-side knowledge to complement Flash F ront end

2007-08-23 Thread Ron Wheeler
I would suggest WebServices as a technology that will be applicable to 
lots of applications.
Axis from Apache has a lot of tools, documentation and links to other 
documentation.


Ron


Dave Watts wrote:

Should I pursue .Net knowledge or ???



You should pursue whatever you think would be most useful for you. .NET,
Java, PHP, ColdFusion - they're basically all the same. They all let you do
the same sorts of things; the differences are largely matters of syntax and
popularity. ColdFusion is arguably the best fit for Flash development,
since it provides Flash Remoting and LiveCycle Data Services (formerly Flex
Data Services), but is not as widely used as the other three I mentioned. On
the other hand, .NET, Java and even ColdFusion are more popular in
enterprise environments than PHP is, for what that's worth.

Fortunately, if you learn one of these, again, they all work the same way,
so it's easy to go from one to the other - my knowledge of CF helped me
learn what I needed for .NET and Java, for example.

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@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


  


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

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


Re: [Flashcoders] Intro to OOP using ActionScript: patterns derail!

2007-08-22 Thread Ron Wheeler



Dave Mennenoh wrote:
How do you handle onLoad's famous scope? ... It is not magic or 
advanced. If a pattern was shown to a new programmer without giving 
it a fancy name, they would just accept it as the best way to do the 
task and would never give it moment's thought.


Right. Delegate - ie Proxy. I agree. I wasn't saying patterns 
shouldn't be taught, or used - I doubt you could teach a Flash class 
these days without teaching Observer, but you might not ever call it 
that. In fact, I wonder who does call it that in a class? Actually, 
the more I think about it, I think for students it might be best not 
to call these patterns and just teach them. Then, once they know how 
to use them, tell them what they are. It's a bit like teaching 
encapsulation I think - if you just show your students how to write 
classes, and they see how classes work for organizing code, they will 
likely just use them.



That is what I have been saying from the start of this discussion.  You 
do not have to teach the fancy names. Just teach them to use proper 
coding practices. OOP and Design Patterns are just names that we use to 
group a bunch of best practices into theories so we can discuss the 
theory and have a framework to critique code. I have a feeling that for 
most of us, the word polymorphism is not much of a help and I see no 
reason to even use the word on 14 year olds until the last week of class 
and only then as a warning that someday someone might try to use it on 
them in a discussion about design.


Ron


Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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



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

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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-22 Thread Ron Wheeler



Ian Thomas wrote:

In reply to Steven:
- Firstly, Wikipedia isn't a great source to quote. :-D
- Secondly, OOP as a style has basic stuff, and it has advanced stuff. I'm
not saying teach inheritance and polymorphism on day 1, I'm saying teach
that objects have properties (and then objects have methods). Not
necessarily because it's _better_ than procedural (we could argue that
forever) but because _almost all day-to-day programming languages that the
students will encounter will involve objects, properties and methods_.

In reply to Alan:

Your first example applies equally to OOP or procedural - it's a code
snippet, not a coding style.

Your second example is overcomplicated - why teach getters and setters from
the word go when a property (public var age:Number;) is far simpler/more
obvious? Yes, getters and setters are part of the OOP paradigm, but not a
requirement.

  
That was my example. You teach people the right way to do it so that 
they never consider addressing a property directly. It may look easier 
but someday, it will break your code in a way that will cause you a lot 
of grief. There are good reasons why it is not done.


Not addressing properties is a requirement of OOP otherwise you break 
encapsulation.


When a person is first starting out, they will not question whether it 
is easier or harder. It just is.None of my test frameworks would ever 
address a property directly. I would not even mention the possibility of 
doing such a silly thing.


If the discussion ever comes up, I would defer it until after the first 
6 weeks and then use it to discuss the reasons why encapsulation is a 
good thing and show why directly addressing properties is inherently evil.


It is also a good introduction into a discussion about programming to 
interfaces which I also would have taught from day one. Not as a topic 
but as a way to specify coding exercises. Give them the interface and 
the program to test the class and ask them to create the class. Do not 
explain why, just let them have the freedom of naming variables and 
programming methods as long as it works with the interface.


From reviewing and discussing each other's code, they would already 
know that the properties of a given class may vary from person to person 
even if the Class is perfectly correct, the variable names follow 
standards and the Class satisfies the interface. They would already know 
that trying to guess property names for a class is impossible and that 
if you switched from one person's implementation to another, your 
program could fail if you have tried to use properties directly.
They would have seen that the test frameworks given for each exercise 
were not implementation dependent..


Ron

Ian


On 8/21/07, Alan MacDougall [EMAIL PROTECTED] wrote:
  

So rather than engage in an argument as to whether OOP or procedural is
better, we're basically asking: Do the additional distractions of OOP
justify the payoff from learning it up front? If you're teaching fellow
geeks, then yes. If you're teaching people with a more casual interest
in programming, or (shudder) people who are required to take the class,
you may want to keep it script-simple. Compare:



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

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


  

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

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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-22 Thread Ron Wheeler



Ian Thomas wrote:

In reply to Steven:
- Firstly, Wikipedia isn't a great source to quote. :-D
- Secondly, OOP as a style has basic stuff, and it has advanced stuff. I'm
not saying teach inheritance and polymorphism on day 1, I'm saying teach
that objects have properties (and then objects have methods). Not
necessarily because it's _better_ than procedural (we could argue that
forever) but because _almost all day-to-day programming languages that the
students will encounter will involve objects, properties and methods_.

In reply to Alan:

Your first example applies equally to OOP or procedural - it's a code
snippet, not a coding style.

Your second example is overcomplicated - why teach getters and setters from
the word go when a property (public var age:Number;) is far simpler/more
obvious? Yes, getters and setters are part of the OOP paradigm, but not a
requirement.

Ian
  
I would probably be more emphatic about getters and setter. If you are 
going to hire an expert ActionScript programmer and they give you code 
samples with public properties in their classes, ask for a copy of the 
liability insurance certificate.
It means that they either lazy or not competent and their code will 
likely contain so-called shortcuts that will cost you a lot of time 
and money later.

If you are going to pay for something, it should at least be safe.

Forgetting the private on a property is a full mark deduction in class.


Ron


On 8/21/07, Alan MacDougall [EMAIL PROTECTED] wrote:
  

So rather than engage in an argument as to whether OOP or procedural is
better, we're basically asking: Do the additional distractions of OOP
justify the payoff from learning it up front? If you're teaching fellow
geeks, then yes. If you're teaching people with a more casual interest
in programming, or (shudder) people who are required to take the class,
you may want to keep it script-simple. Compare:



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

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


  

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

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


Re: [Flashcoders] This is not Java: property accessors

2007-08-22 Thread Ron Wheeler



T. Michael Keesey wrote:

On 8/22/07, Alan MacDougall [EMAIL PROTECTED] wrote:
  

Further derail! What are people's thoughts on implicit vs. explicit
accessors? I prefer explicit ones, but I confess that it's almost
entirely because I learned Java before Actionscript.



I think a lot of it has to do with readability. Compare:

clipA.setWidth(clipB.getWidth() + clipC.getX());

clipA.width = clipB.width + clipC.x;

And another point: Suppose you start out making something as a public
field and then later realize you need to restrict its value in some
way. With properties, this change will make absolutely no difference
to the rest of your code. Without properties, you will have to change
every instance of obj.myField = x to obj.setMyField(x) and every
other instance of obj.myField to obj.getMyField(). So it makes
this type of refactoring far easier.
  
You start with every property private and you never have to refactor the 
rest of your code (encapsulation)
That is the tradeoff between readibility and less typing against 
robustness and predictable refactoring.



Personally I find properties (i.e., implicit getters and setters) to
be one of ActionScript's few advantages over Java as a language. (Now
if only we could have abstract classes, exception types in function
signatures, etc)
  

I am not sure if this helps but it makes interesting reading.
http://nodename.com/blog/2005/09/19/abstract-classes/
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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


Re: [Flashcoders] Property Access

2007-08-22 Thread Ron Wheeler



Steven Sacks wrote:

I wouldn't even go so far as to say he's 99% right.  More like 33.3%.

Private properties with Public getters and setters is used for one of
three reasons.

1) You need to do adjust the value of the property when set or get, such
as applying limits (max value is 100 so if you pass 150, set it to 100),
or storing the value internally as something different and returning a
modified value (internally using .5, but the API accepts 50).

2) You need to update the class when a property is set or get.

3) You need protection against dummies.


4) You need protection from the customer changing his mind once you have 
finished. That is what I mean by robustness.
If you have to do 1) after you have got the first version running, now 
you have to search through all the code that references the class to see 
if it sets the property.


If you examine the ratio of dummies getting to program with my code  to 
customers that change their requirements, dummies are less of a concern.



#3 is what Ron is talking about here, because if you're not doing #1 or
#2, then you don't need getters and setters.

I use public properties when appropriate.  I only use getters and 
setters when I need to do something to the property prior to setting 
it (such as limits) or some kind of update to the class when the 
property changes.


There's such a thing as over-architecting.  OOP sacrifices speed for 
flexibility and scalability.  You shouldn't overdo it with unnecessary 
function calls for setting public properties.  It causes code bloat 
and your code doesn't perform as well.  I don't wrote code for the 
lowest common denominator.  I've got work to get done.
If your work has to maintained or used by others as a base, you have no 
control about who is going to do it.


We're Flash developers, not C++ developers.  We can't bring down the 
operating system with a bad value.  Some of these safeguards are in 
place because lower-level languages can cause real damage.  The only 
thing that can happen in Flash is that particular swf might have 
problems.  You can't bring down a system by missetting a property in 
Flash.
You can bring down an application that is critical for the business. I 
don't care what people do for their own amusement but if I am paying the 
bill, I want it done in a way that is robust and not going to embarrass 
the company or get us sued. Our Flash eLearning system (ALI) has run 
without problems for years at clients' sites.
How important to the client would it be if they had flown soldiers in 
from all across the country to take a course and the course would not 
work because of a change in the requirements that broke some other function?
Granted, it will not start a nuclear war but the chance of doing 
additional business will be damaged severely.


The ALI is not perfectly coded by any stretch but I tried to get it 
done, on schedule, in a way that does not require any maintenance. It 
has proven to be capable of being modified to meet new needs and ideas 
without breaking existing code.


According to Ron Wheeler, I'm a bad coder.  I respectfully disagree. :)
Disagreeing with me is not, in itself, evidence of much. If I was to 
hire you as a consultant, I would be careful about standards and design 
reviews.
Coding does not bother me as much as design. I would look for your 
interfaces definitions and your class structures.
I am sure that once we had a meeting of the minds, everything would be 
fine. I can be a bit flexible, if the case is well made.


Don't forget that this started out as a discussion about teach newbies. 
Not converting old farts.


Ron


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

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



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

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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Ron Wheeler
I do not believe that starting people out doing things the wrong way is 
ever a good start.
Teach OOP from the day one. Not as a name or a theory but as a normal 
way to program.
Just start with simple classes and give the students a framework for 
testing that they do not have to deal with.


You can start with very simple classes representing everyday objects 
that everyone can understand.
You can introduce various types of variables very easily - one at a 
time. (Cats have a name, add in age, later add date of birth)
You can add Arrarys very easily in the context of a real world object. 
(Add in an array of offspring)


If you provide the Pet interface with the test program, the students 
will see how their names for properties do not matter.


By the time you have to explain what OOP is, the kids will already be 
programming OOP and wonder why anyone ever did it any other way.


Ron

Alan MacDougall wrote:
Start small and work your way up. You don't need classes until the 
functions start to get unmanageable. That won't happen until you've 
thoroughly covered variables and control structures. By the time 
classes are necessary, the students should be relieved to have a way 
to organize their forest of elaborate functions. Even if they're 
introduced in an organic and natural way, like building a Swing 
application, they're going to just be one more distraction for people 
who are struggling with the syntax of a for loop. They're an 
intermediate topic, treat them as one.


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

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



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

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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Ron Wheeler

Can you explain to me how a function is intrinsically simpler than a method?

I have a feeling that there is a lot more mythology about OOP than there 
should be.

1) OOP uses the same compiler as spaghetti code.
2) OOP is written using procedural languages (the opposite of procedural 
is declarative)
3)OOP is based on some interesting theory and has a funny vocabulary but 
if you ignore all of these linguistic shortcuts and just explain what 
you mean, it is pretty simple.
4) OOP generally results in the average programmer producing code that 
is easier to debug and maintain that the average programmer used to be 
capable of doing. It is not a cure-all for stupidity or lazy thinking. 
It is just easier to spot and fix poorly written code.
5) OOP is a way to approach design; more beginning programmers (and 
experienced programmers) have trouble with design than coding.
6) OOP will not cure baldness but it will reduce the number of times you 
are pulling your hair out in frustration over a programming error.


Ron


chris duke wrote:

I see it as something of a Math class (my degree is in math so bear with
me). People aren't just going to be thrown into Calculus before at least
learning algebra. There is some argument that teaching calculus sooner could
be beneficial (i'm in that camp but theres a whole different set of issues
there), but at the same time its hard to imagine learning calculus without
at least having some concept of what infinite means. Same would go for OOP
- you couldn't learn it without first knowing what function means. Sure
you could teach it during the class, but why not get all of that out of the
way along with other simpler concepts in a foundations class before actually
brining OOP into the picture. Much the same way you are taught how to
compute area, and limits, before being thrown into derivatives and
integrals.

-CD

On 8/21/07, [p e r c e p t i c o n] [EMAIL PROTECTED] wrote:
  

most college programming courses have prerequisites right?

personally i know many programmers who don't have a background in
programming who jumped right into oop...just looking at the code i can
tell
what they understand about programming let alone oop...


my 0.02 pieces of lint

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

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



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

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


  

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

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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Ron Wheeler

They do know their names.
They are just not going to give you the satisfaction of coming just 
because you called them.

That is what dogs were invented for.

Ron


Troy Rollins wrote:


On Aug 21, 2007, at 3:54 PM, Ron Wheeler wrote:

Lesson 2 How do you set/change a cats name? How do you create 2 cats 
with different names? Now they know about setters and getters and 
methods with parameters.


Now you are *really* talking about encapsulation...

since everyone knows that cats don't know their own names.

--
Troy
RPSystems, Ltd.
http://www.rpsystems.net


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

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



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

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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Ron Wheeler

Interesting point.

My counter would be that at the age of 14, these kids already have a 
good understanding of  foo+bar (and knowing to days kids fubar as well.)


I am not trying to teach them arithmetic. I am interested in showing 
them how arithmetic is used in the context of programming to accomplish 
something worthwhile like adding up the age of 2 cats.
Fortunately the + operation maps pretty well into the vocabulary of 
arithmetic so I would not expect students shown either example to 
flounder on the + sign.


I really want to teach them the right way to represent cats as things 
inside a computer and to manipulate these abstractions as easily or more 
easily than they can manipulate realworld cats. And to be able to extend 
this same approach to dogs, credit cards, photographs, etc.


Ron


Alan MacDougall wrote:


I don't think you need to call it procedural. Just call it the basic
building blocks that they will need for OOP (or procedural, for that
matter).

There's not that much difference, really, between OOP and procedural. 
OOP

just encapsulates chunks of procedural code and its data.
This is the correct answer. OOP probably isn't a bad framework in 
which to teach these things, but when you start teaching you may be 
surprised by how many students have a hard time grasping concepts that 
may seem simple to you, even as simple as the relationship between a 
class and an instance. You will also see students who blur through the 
work and get bored five minutes after each class starts... but they 
aren't the ones we're worried about.


So rather than engage in an argument as to whether OOP or procedural 
is better, we're basically asking: Do the additional distractions of 
OOP justify the payoff from learning it up front? If you're teaching 
fellow geeks, then yes. If you're teaching people with a more casual 
interest in programming, or (shudder) people who are required to take 
the class, you may want to keep it script-simple. Compare:


var foo:Number = 1;
var bar:Number = 2;
trace(foo + bar);

vs.

class Cat
{
   private var age:Number;
   public function setAge(age:Number):Void   {this.age = age;}
   public function getAge():Number   {return age;}
}

var whiskers:Cat = new Cat();
whiskers.setAge(1);
var patches:Cat = new Cat();
patches.setAge(2);
trace(whiskers.getAge() + patches.getAge());

Is it so unrealistic to suggest that the second example, while having 
a pleasant real-world basis, involves many more steps and logical 
leaps for an absolute beginner to understand?


Maybe this is a strawman... I guess you could start with how getters 
and setters work in the first place, and use that to explain 
functions/methods. It just seems like a bit too much drapery to start 
out with.


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

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



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

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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Ron Wheeler



T. Michael Keesey wrote:

On 8/21/07, Steven Sacks [EMAIL PROTECTED] wrote:
  

Object-oriented programming (OOP) is a programming paradigm that uses
objects and their interactions to design applications and computer
programs. It is based on several techniques, including inheritance,
modularity, polymorphism, and encapsulation.

OOP is based on the things you acknowledge are advanced topics.  Ipso
facto, OOP is advanced, right?  ;)



I think there's actually more agreement than disagreement here. Nobody
is arguing that you should be teaching polymorphism on the second day,
just that you can start to introduce objects at an early stage. I
mean, if you can start with:

x = 500;
trace(x);

... you could certainly also start with:

myShape.x = 500;
  

I hope that you meant
myshape.setX(500); 

The core basics of OOP--using fields and methods--are not that far
beyond the core basics of programming--using variables and functions.
Of course inheritance, polymorphism, encapsulation, etc. come much
later, and design patterns even later. No one would dispute that, I
think.
  

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

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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Ron Wheeler
That is the problem when you have to use someone's API and it does not 
follow standards.
They probably wrote it before we know the right way to do getters and 
setters - or they never bothered to read up on the state of the art in 
programming.


Ron

T. Michael Keesey wrote:

On 8/21/07, Ron Wheeler [EMAIL PROTECTED] wrote:
  

myShape.x = 500;
  

I hope that you meant
myshape.setX(500);



Huh?

No, that's not part of the flash.display.Shape API. And while it's
true that x in this context is actually not a true field, but a pair
of methods (__get__x and __set__x, not getX and setX) disguised as a
field, I think you can safely ignore that in an introductory class.
  

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

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


Re: [Flashcoders] Intro to OOP using ActionScript: patterns derail!

2007-08-21 Thread Ron Wheeler



Alan MacDougall wrote:

Dave Mennenoh wrote:


Lots of programmers never need design patterns as they don't help 
much unless your architecting large apps, and lots of Flash 
programmers aren't developing those kinds of apps. Keeping your code 
organized however should be taught from day one and certain oop 
concepts are perfect for that.


There are plenty of patterns that can apply well to small-scale 
projects: take undo. How would you cleanly support undo without 
Command? Other patterns like State, Adapter, Observer (especially to 
overcome the sadistic limitations of Flash's single callbacks -- 
MovieClip -- or single listeners -- MovieClipLoader)... all have uses 
even in a sporty little website tchotchke. Not every 'design pattern' 
is something like MVC or data mapping or dynamically-configured 
factories.


On the other hand, I got your point.
Design patterns are not some esoteric way of doing things. They are 
solutions to common programming situations that came up over and over again.
For years, we all wrote our own way to accomplish these tasks. Finally 
some experienced guys looked at what they were doing and what other 
people were doing. They had a Holy Sh*t moment when they realized that 
they had 50 ways to do exactly the same thing. They looked at the 
various ways and tried to pick the best strategy.
A design pattern book is not a road map to building an application. It 
is a collection of best practices for the tasks that come up all the time.
It hard to imagine even a small program that could not use at least one 
of the design patterns that have been identified.
It is hard to imagine a Flash program that would not be a candidate for 
several design patterns. A game with no Listener/Observer is hard to 
imagine. (How many onEnterFrames does it take to kill a program? )
How do you handle onLoad's famous scope?  There is a design pattern for 
this and it gets explained every time a new flashcoder tries to read an 
XML file. You can probably find this in the archives once every 2 weeks. 
They do not call it a Design Pattern but it is.


If you doubt the usefulness of Design Patterns, read Head First Design 
Patterns. You will read each section and sometimes be amazed at the 
simplicity of the solution and wonder why you never figured this out. In 
other sections you will say What is the big deal? I do it like this all 
the time.


It is not magic or advanced. If a pattern was shown to a new programmer 
without giving it a fancy name, they would just accept it as the best 
way to do the task and would never give it moment's thought. If you were 
trying to get the class to build a game, you would be foolish not to 
explain the Observer pattern. It is very simple and the alternatives are 
often really ugly and overly complex and frustrate the best of us.



Ron


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

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



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

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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Ron Wheeler



T. Michael Keesey wrote:

On 8/21/07, Ron Wheeler [EMAIL PROTECTED] wrote:
  

T. Michael Keesey wrote:


On 8/21/07, Ron Wheeler [EMAIL PROTECTED] wrote:

  

myShape.x = 500;

  

I hope that you meant
myshape.setX(500);



Huh?

No, that's not part of the flash.display.Shape API. And while it's
true that x in this context is actually not a true field, but a pair
of methods (__get__x and __set__x, not getX and setX) disguised as a
field, I think you can safely ignore that in an introductory class.
  

That is the problem when you have to use someone's API and it does not
follow standards.
They probably wrote it before we know the right way to do getters and
setters - or they never bothered to read up on the state of the art in
programming.



Uh, you do realize that is Adobe's own API, right?

  
I have been building RIAs in Flash since AS1. I am under no illusions 
about  Macromedia. They wrote AS1without reading ECMA spec or even 
looking at Java. We were using Eclipse and talking about in this forum, 
2 years before Macromedia adopted it.
The lack of standardization in the old components and Classes is not 
something to emulate or teach as a good model.
To be fair, they have really got a lot better once they realized that 
there is a strong community that uses Flash for building real 
applications that have to be robust and maintainable in the real world.


Ron

http://livedocs.adobe.com/flex/2/langref/flash/display/Shape.html#propertySummary

That is the proper way to do getters and setters in ActionScript
(2.0 and 3.0). This isn't Java.

  

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

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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread Ron Wheeler



Mike Reilly wrote:

Thanks Ron, I think you've found my wavelength (as fluctuating as it
might be).  I agree on that patterns would be awesome to teach, as
early as they can conceive what an object is.

The book Objects First by Kolling is my inspiration for doing this,
it's aimed at the right level.  Take a game apart, understand the
objects, understand the classes that make them up, tweak the classes,
build some classes, inheritance, etc.

  
I like the coding techniques that are used in the patterns. It does show 
how a lot of functionality can be produced with minimal code by 
intelligent use of objects.
I am not sure that I would teach them as Patterns. I would just use 
the patterns as examples of how to get things done. It is nice that they 
have names and everyone knows what you mean when you say decorator 
but I am not sure that the names are as important as knowing how to get 
things done well.


Patterns are not separate from OOP, they are just best practices for 
using OOP in an intelligent way.


The Head First Design Pattern book is very good in this regard and the 
examples are very short and use entertaining examples that everyone can 
understand - make a duck quack and fly - then throw in a rubber duck and 
see how little it takes to modify the duck objects to deal with squeaky, 
non-flying ducks.
Their Decorator pattern makes a nice introduction into the power of 
objects which is a lot more concrete than a whole discussion about the 
theory.
The examples are in Java so you have to make some small adjustments and 
you probably want to give them a MovieClip to draw on rather than a 
console to write on so your standard main test program will be different.


If you are going to try to use games in Flash as the theme, you want to 
walk them through the Listener pattern early on since you will need this 
one to avoid a real mess in handling user events.



I'll also take a look at Sandy, 3D would be so cool!

If you have the time (I'm assuming you don't, so no pressure), could
you teach me about how I would use intervals for something like a
simple Paddle class in Pong?  Just something for KeyListeners, to move
the paddle object.
Use events to find out about user inputs. Keys being released means the 
user wants something done.
Use intervals to generate events that are time related (wake up every 
1/x of a second to move the ball.) When you wake up, check the state of 
things, do what needs to be done (move the ball, update the clock or 
timer, ) and set a new interval.
You can also do these things when the user presses a key, just cancel 
your pending interval and set a new one.
If you use the Listener pattern it gets very easy to add functions to 
the list of things that need to get done when the central event handler 
wakes up or responds.

  This is one of the first lessons I would like to
get across, using a class from the Library of a movie for two
instances.  After Pong I was going to move toward Space Invaders, to
throw in Arrays and reinforce the class - objects relationship.

  
rantTeach them about arrays of objects. Don't let them put anything 
else in an array. It would be nice to find a bunch of programmers that 
are surprised to find out that you can put numbers in an array rather 
than the current case where the opposite is true and people create 
horrible messes of parallel, multidimensional arrays when an array of 
objects would be much clearer and require a lot less code and infinitely 
less debugging time. /rant

Thanks again!
Mike

On 8/19/07, Ron Wheeler [EMAIL PROTECTED] wrote:
  

You might also want to look at Sandy.
It is a 3D engine for Actionscript.
Very easy to build 3D applications that might be fun for the kids.

Check out Script_in_Action forum for resources and links.


Mike Reilly wrote:


Thanks so much to all of you for such quick responses.  I'm sure my
students will benefit from many of the links that you've already sent.

Since I'm not the best at clarity when writing, I'll throw out what
started this thinking.  I read Andy Harris' Beginning Flash Game
Programming For Dummies, and I think the level of that book was
awesome for intro.  I have also been using Greenfoot.org as a
supplement to teach Java, as kids love games whether it's intro or
more advanced (remember, these are 14-17 year olds, and we're trying
to generate an interest in programming).

So this semester I'll be trying to develop an OO approach, using
Actionscript (can't install anything else without formal district
approval).  Some of the resources forwarded should be very helpful,
and I truly appreciate all support.

I'll be reading Moock's Essential ActionScript 2.0, combining it
with Harris' Dummies, to create Essential Games for Dummies!

On a serious note, how do you get an enter_frame event handler to
work inside an AS file?

  

It works but you shouldn't use it . Look at using intervals.
Try not to teach bad programming practices to kids at that age.

You might also want

Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread Ron Wheeler
What is a subroutine? Not used in this millennium. Seems to be a 
concept from the distant past.


Start with OOP. We did not get  here by accident.
It is easier. It is less prone to errors. It makes your coding examples 
much smaller and much easier to grasp.


Their code exists in a small context. You can write the test programs to 
get them started and let the students start by programming simple 
classes that compile on their own and can be incorporated into your test 
environment which they do not have to deal with until you are ready to 
show them the object that uses their simple class.


Define the interface that their code must implement (might as well get 
them used to programming to an interface), let them extend your interface.
Show them how the interface is the contract between the user and the 
class.
If you give them the interface class with lots of comments about the 
functionality required for each method, you have the description of the 
assignment.


Ron


Johannes Nel wrote:

i think teaching someone OOP from the begining is not a bad idea, you are
still teching them to code but around classes. you do not need to introduce
more advanced concepts until later.  the best free book i think is thinking
in java by bruce eckel and should be easily adaptable for your needs.
i also think as3 is a good place to start, you would be equipping them with
a better language while still allowing them to do graphics. those who want
to learn more coding will slot easier into languages like java, c# etc.

On 8/20/07, Ricky Bacon [EMAIL PROTECTED] wrote:
  

Steven Sacks wrote:


I think you should consider teaching programming basics, focusing on
clean code, best practices, naming conventions, etc. and touch on OOP
towards the end.  The people who are most interested will seek out more
information, but I think you will lose people if you try to teach OOP
concepts right out the gate before they even know how to iterate through
an Array, or before they know what a subroutine is.
  

LISP?  Just sayin...

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

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






  

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

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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread Ron Wheeler
They do claim that men never pass the emotional age of 12 and I have 
with guys who were 5 with 30 years of experience.. So 4 and 14 are not 
so far apart (on the male side at least).



T. Michael Keesey wrote:

On 8/19/07, Ron Wheeler [EMAIL PROTECTED] wrote:
  

Some of the Heads Up Design Patterns examples are fun and designed to
appeal to the 14 year old in all of us. (How does your duck quack? What
if it is a rubber duck?)



14-year-old or 4-year-old?

  

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

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


[Flashcoders] [Script_in_Action] New Links

2007-08-20 Thread Ron Wheeler
I have added a lot of new links for general graphic design.
Some new links to programming books have been added as well.
Please check out the Links section and let me know of new links that
should be added.
I would like to hear from people who are using components that should
be included.

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

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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-20 Thread Ron Wheeler

You can learn the basics while using OOP.
It is just easier. You can start with simple objects and still write a 
complete piece of code that has a set of well-defined behaviours and can 
be stuck into a test program without having to deal with the whole nasty 
story at once.


I am not sure how OOP eliminates procedural code unless procedural code 
is taken to mean spaghetti code where the execution path is 
unpredictable and every variable starts _root.


It is hard to see how you have many classes with no properties so I 
think that the students will find out about Strings, etc.
Some objects will need Arrays of other objects so I am pretty sure that 
you can get to Arrays at some point.
Class methods have been known to have iterations in them so that can be 
covered.

Might even get to recursion!!!

Naming conventions are essential. Worthwhile to make sure that all of 
your examples are 100% correct and deduct bigtime for assignments with 
violations of conventions. This gets very important when you start to 
get into frameworks which use class inspection to find things.


I would not worry about AS1 and maintaining other people's crappy code. 
If they are lucky, they will be too late into the fray and we will have 
fixed up all of the crap by then.
Realistacally,  it is unlikely that any of them will actually ever make 
a living from ActionScript programming since most of them will probably 
end up in other fields since it is a high-school not a university course.


Ron

Steven Sacks wrote:
If these students have no experience programming, you just can't start 
with OOP.  They have no foundation to understand the concepts.  You 
have to walk before you can run, and OOP is definitely runners 
territory. Students with no programming experience are barely 
crawling.  Arrays, Strings, Objects, Functions, Variables - these 
things are your first steps.  You can't learn those while learning 
about Classes, Inheritance,  and Design Patterns.  Those things are 
based on solid foundations.


Anyone here who says they would have been better off if they learned 
OOP from the get-go is dismissing everything it took to get where they 
are.  Procedural code has its purpose sometimes and knowing how and 
when to use it is important, especially in Flash.


I disagree with the statement that AS2 is on the way out.  Jesse 
Warden blogged about that very subject which mirrored my own feelings 
on the subject.  AS2 will be around for some time to come.  The fact 
is, AS3 is such a leap from AS2 most Flash developers will not be able 
to (or want to) make the leap.  Only senior level coders will, and 
certain bright designer/coder types.  Eventually, people might, but 
agencies will be able to turn out great Flash sites with AS2 (even 
AS1) for years to come.


The fact is, you can still do a lot in Flash by hacking AS1 procedural 
code, and this skill is an absolute requirement in agency work where 
you're working with short timelines, ridiculous client changes 
throughout the process, and the site is a churn and burn never to be 
touched again after it goes live.  AS2/AS1 is going to remain king in 
that very large sect of Flash development for some time to come.


If you were teaching Java or Ruby, I would say go OOP right away.  But 
Flash is only now becoming OOP strong and AS3, while a good step in 
the right direction, is not the absolute best OOP language to teach 
because of all the other things that make up Flash development that 
have less to do with Actionscript and more to do with Flash itself.  
Ruby is a fantastic OOP language, though it might be a bit heady for 
newbies.


I think you should consider teaching programming basics, focusing on 
clean code, best practices, naming conventions, etc. and touch on OOP 
towards the end.  The people who are most interested will seek out 
more information, but I think you will lose people if you try to teach 
OOP concepts right out the gate before they even know how to iterate 
through an Array, or before they know what a subroutine is.



Steven Sacks
Flash Maestro
Los Angeles, CA
--
blog: http://www.stevensacks.net
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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



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

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


Re: [Flashcoders] accessing super fields

2007-08-20 Thread Ron Wheeler



Hans Wichman wrote:

Hi,

okay thanks that comes as closest to an explanation as I'd like I
guess, but.

If I declare a method test() in superclass, i can call it from the subclass
using super.test().
Whether I have overwritten it or not.

So why doesnt the same go for fields.

  

Think about what this would mean.

How would the methods in the superclass ever reference any variable?. 
Which _test would it use? How would the super class know that you had 
overriden _test?


You would have to override every method to make such an idea work. Then 
you do not have extends anymore.


Take a second and think about this. It can not work any other way.

Ron



I think its a bug to be honest.

As Benny said, you dont need to, no i know! But appearantly it works
different for fields than for methods.

greetz
JC


On 8/20/07, Kerry Thompson [EMAIL PROTECTED] wrote:
  

Hans Wichman wrote:


lets say i have a superclass:

class SuperClass {
 private var _test:String = null;
}

and a subclass:

class SubClass {
private function _testFunction () {
  super._test = foo;
trace (super._test);
}
}


this traces undefined.

If I remove the super. it works, but I like to know when I'm referencing
super class fields.
  

Actually, you're not referring to a superclass field in this instance.
Your
subclass inherits all the methods and variables of the superclass, so
_test
is a member of the object you create using SubClass.

You need to use super when you have overridden a method or variable. For
example, if you have an Init() method in both, and you want to run the
superclass's Init() first, you would call super.Init();

Otherwise, you treat inherited methods and vars as if they were part of
the
subclass--which they are. They're just inherited, not declared.

Cordially,

Kerry Thompson


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

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



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

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


  

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

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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-19 Thread Ron Wheeler

You might also want to look at Sandy.
It is a 3D engine for Actionscript.
Very easy to build 3D applications that might be fun for the kids.

Check out Script_in_Action forum for resources and links.


Mike Reilly wrote:

Thanks so much to all of you for such quick responses.  I'm sure my
students will benefit from many of the links that you've already sent.

Since I'm not the best at clarity when writing, I'll throw out what
started this thinking.  I read Andy Harris' Beginning Flash Game
Programming For Dummies, and I think the level of that book was
awesome for intro.  I have also been using Greenfoot.org as a
supplement to teach Java, as kids love games whether it's intro or
more advanced (remember, these are 14-17 year olds, and we're trying
to generate an interest in programming).

So this semester I'll be trying to develop an OO approach, using
Actionscript (can't install anything else without formal district
approval).  Some of the resources forwarded should be very helpful,
and I truly appreciate all support.

I'll be reading Moock's Essential ActionScript 2.0, combining it
with Harris' Dummies, to create Essential Games for Dummies!

On a serious note, how do you get an enter_frame event handler to
work inside an AS file?
  

It works but you shouldn't use it . Look at using intervals.
Try not to teach bad programming practices to kids at that age.

You might also want to read Heads Up Design Patterns just to find out 
the right way to do many things. It is oriented to Java but all 
relevant to ActionScript.


Ron

Thanks again, I won't bother you all much more.  Please take a look at
last year's kids work:  www.nghsit.com/studyhall

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

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


  

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

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


Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-19 Thread Ron Wheeler



Mike Reilly wrote:

I think we're on the same path Roy.  While I have some future coders,
this is Intro for 9th-11th grade kids, so my task is to teach but also
whet their appetite for more.  My deeper desire is to do it as OO as
possible, to better prepare them for AP Comp Sci if they choose.

I used to be the Co-Director of TechBoston up there in Boston, wish I
were closer. I'm in Georgia now.

If you're interested in doing more of an OO spin, let me know and I'll
keep you in the loop.

  
There is no reason not to follow OOP principles to the hilt. You have 
all of the essential structures in ActionScript.
You might also try to explain MVC and show how this helps simplify 
programming.
MVC and OOP will give your students a really good way to get a lot done 
with a little bit of code.


Some of the Heads Up Design Patterns examples are fun and designed to 
appeal to the 14 year old in all of us. (How does your duck quack? What 
if it is a rubber duck?)


Ron


Thanks!

Mike

On 8/19/07, Roy Pardi [EMAIL PROTECTED] wrote:
  

At 8:19 PM -0400 8/19/07, Mike Reilly wrote:


Hi there -

I'm a high school teacher who's decided to teach Intro to
Programming using Actionscript (2.0 for now, waiting for the school
to upgrade).

I'd prefer to take an OO approach, and use games in doing so.  For
example, my first game would be a Pong copy.  Lots of basics in there
to learn the environment, basic principles, etc.
  

Hi Mike,

I'm teaching an AS 2 class for non-programmers at Northeastern this Summer
(they haven't upgraded yet either). I use Pong as a basic example (and then
beat it to death.. ;-) Not true OOP with this group but I introduce the
ideas. The class site is here: http://roypardi.com/neu_summer/ - maybe this
will give you some ideas of what to do (or not to do..).

--Roy
--
-
Studio Site Updated!
http://www.roypardi.com/


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

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



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

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


  

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

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


Re: [Flashcoders] [OT] Improve my design skills

2007-08-18 Thread Ron Wheeler

I have added many of these links to Script_in_Action

Ron

Jesse Graupmann wrote:

Just look around, go to a contemporary bookstore and read up on design
history, and then see how it has evolved.

http://witcombe.sbc.edu/ARTHLinks.html
http://www.architectureweek.com/2001/0905/culture_1-1.html

http://www.typorganism.com/
http://typographica.org/

http://diuf.unifr.ch/people/bertinie/visuale/ 
http://infosthetics.com/ 
http://www.howdesign.com/blog/ 

http://www.smashingmagazine.com/ 


http://www.youworkforthem.com/

http://www.core77.com/
http://www.k10k.net/
http://styleboost.com/
http://www.thefwa.com/

http://www.joshspear.com/ 
http://spearcollective.com/ 
http://www.boredomisyourfault.com/blog/

http://www.designobserver.com/index.html
http://www.underconsideration.com/brandnew/
http://www.hallmonitor.org/blog/

http://www.commarts.com/ 

http://www.artlebedev.com/everything/id/ 
http://www.teague.com/ 


http://www.aiga.org/

http://www.wertco.com/ - industry resources

http://gizmodo.com 
http://www.hackaday.com

http://www.richardbanks.com/trends/


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

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


  

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

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


Re: [Flashcoders] [OT] Improve my design skills

2007-08-17 Thread Ron Wheeler

One of the best books is Head First Design Patterns.
Really nice code. Well explained and shows how to get a lot of mileage 
out of code through thoughtful design.
It will make you a better coder and get you thinking about design in new 
ways.
http://groups.yahoo.com/group/Script_in_Action has links to more book 
and on-line resources


Ron

Marcelo de Moraes Serpa wrote:

Hello folks,

I'm currently mainly a coder, but I also love graphics design and design in
general. I would love to improve my overall design awareness. Does anyone
have any book (or any other resource such as website, magazine, mailing
list, whatever) to recommend ? If so, I would be grateful!

Thanks,

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

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


  

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

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


Re: [Flashcoders] Classes 101 [was: Version control and Flash ]

2007-08-13 Thread Ron Wheeler
I do not believe that we have had to extend MovieClip in any application 
so far.
We tend to treat Movie Clips as a stage where you put things that you 
want rendered rather that a functional object.


I am not sure that I know the high level theoretical argument but one 
does see a lot of really strange code and problems come through the 
forum from people who have tried to bend a MovieClip into something that 
it really was never intended to be.


When you are trying to decide what Object to subclass, look at the basic 
tenets of OOP and decide if your new class is really an extension of a 
MovieClip or just a View object that needs a MovieClip to draw on.


If you just want to draw something on a MovieClip then create an Object 
that has a function/method that gets a MovieClip object as a parameter 
and draws on it. This makes your Object much easier to write and 
understand and  is likely a lot more reusable.


Ron


Michael Trim wrote:
Not all classes have to extend MovieClip (in fact, most shouldn't, and 


some would argue none should).

Just as an aside, I'd be interested to hear why some would argue that
you should never extend MovieClip? (Surely you have to for the Document
class) or is this a higher level theoretical argument?
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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



  

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

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


Re: [Flashcoders] Classes 101 [was: Version control and Flash ]

2007-08-11 Thread Ron Wheeler

Some on-line resources
General OOP
http://java.sun.com/docs/books/tutorial/java/concepts/index.html - 
short, clear and free

http://www.aonaware.com/OOP1.htm - basic stuff again.
http://www.desy.de/gna/html/cc/Tutorial/tutorial.html - very long and 
detail - step by step  walk through the rational behind OOP - C++ from 1997


Actionscript and OOP
http://polygeek.com/360_adobeflash/actionscript_the-best-way-to-start-learning-object-oriented-programming-in-actionscript 
- a pre-course briefing to get you ready for OOP in ActionScript

http://www.moock.org/lectures/introToOOP/
http://www.kirupa.com/developer/oop2/AS2OOPindex.htm
http://www.flashscript.biz/MX2004/OOP_tutorial/lesson1.html
http://www.debreuil.com/docs/ch01_Intro.htm - Flash 5 but the OO part 
has not changed a lot.


I have added these links to
http://tech.groups.yahoo.com/group/Script_in_Action/

Also check out the books.
I highly recommend Head First Design Patterns if you want to see the 
power of objects clearly demonstrated.
It will save you hours of grappling with the design of your classes and 
cut your code in half while increasing robustness and reusability.


Ron

Marcelo Wolfgang wrote:

On 8/10/07, Hans Wichman [EMAIL PROTECTED] wrote:
  

Hehe no worries there, I'm sure we all do stuff that causes someone else to
say they need to kill... etc :)
It was meant as a joke nothing harsh to be honest:).



I got it :)

  

You are hijacking this thread though, which is in itself ofcourse enough
reason to ... :)



Sorry, I was about to ask about this for quite sometime, but I'm too
f. busy recently and when I saw the joke I had to answer :)


  

Some answer though:
- you dont code AS2 classes on frames, you just write as2 classes in files.
Once you compile your movie, flash lets you specify in which frame your
classes should be exported.



I think what I don't get the most is how do I transform this

function myFunction(){
  return this;
}

to a class and how I can call it later in something like

btClose_mc.onRelease = myFunction();

i'm thinking in buying moock's essential actionscript 3, but I'm
afraid it will hard to jump from where I'm now to where the book is.

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

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


  

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

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


Re: [Flashcoders] Version control and Flash

2007-08-10 Thread Ron Wheeler



Rick Schmitty wrote:

We are starting to add our flash projects to SVN but by large every
project has all of the AS code inside the actual movie leaving us with
just fla's in the repo

  
We are working on getting everyone to develop with .as files they

include in the fla, but is there a limit as to how far that should go?
  
When you have all of the includes gone and all of the code out of the 
fla's you will be ready to start developing new functionality.

Should there be any code in the flas besides the #includes?
  
No. No includes either. You probably do not need any fla files either 
once you get off the timeline unless you are doing animations but they 
will not be hard to build or manage once they have no connection to script.

How do you go about organizing your folders when you are making an
AS1/AS2 project?
  

Into packages.
Under the src directory build a tree
com.
   smitty.
   yourapplication
  model
  view
 controller
 util


Do you mimic the folders in the fla with the appropriate as file locations?

  
Nothing in the fla's except animations. Draw everything else on a stage. 
If you want a button, create one in ActionScript and put it on the stage 
or use Flex or  ActionStep or some other view technology

I'd like to make it easier for everyone to use SVN while still getting
the benefit of having plain text code in the repo

  
You are on the right track. Get your code into Eclipse, get the 
ActionScript plug-in and program with the pros. Save your Flash licenses 
for the animators.

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

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


  

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

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


Re: [Flashcoders] Dynamically setting properties...

2007-08-09 Thread Ron Wheeler

I would think that the trace on a_sprite would be more interesting.
I am not sure what

  a_sprite[i] = obj[i];

is actually supposed to do.
The code extract does not show how a_sprite[i] comes into existence or 
what a_sprite[i] is.

To my untrained eye it looks like you are creating an array of  obj's.
To use them, you would need to do
   myobj=a_sprite[1]
   trace (myobj.getProperty1());  //show the value of property1 from 
the second obj in a_sprite.


I may be all wet but it would be helpful to see more of the code and to 
see the results of the traces.


Saying that you put traces in and everything is fine and matches up but 
still does not work does not give us much to go on.
The classical bug description would be helpful. Here is what I did. 
This is what I expected. This is what happened


Ron


Karim wrote:

Already added the trace, all props in my obj are fine and match up with the
getter/setters in the class. 


FYI: I am adding these properties to instances of classes ( that extend
movieclip, project is AS2)..


Karim


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of JOR
Sent: 08 August 2007 18:22
To: flashcoders@chattyfig.figleaf.com
Subject: Re: [Flashcoders] Dynamically setting properties...

What is the error you're getting?

Maybe add a trace statement in there to see where it's breaking.  You 
could be trying to set a property that exists only in obj but not in 
a_sprite.


for ( var i in obj ) {
   trace (i +  =  + obj[i]);
   a_sprite[i] = obj[i];
}

-- James


James O'Reilly  —  Consultant
Adobe Certified Flash Expert
http://www.jamesor.com
Design • Code • Train



Karim Beyrouti wrote:
  

Hi List,


I am trying to add values to properties a classes, the classes properties
are defined like this:

function get isActive():Boolean{ return _isActive; }
function set isActive( val:Boolean):Void{ _isActive= val; }

 so instead of douing this to add values to the class:

if ( obj.isActive!= undefined ) myClass.isActive = obj.isActive

I am trying to do something like this ( as I have quite a lot of


properties
  

/ different classes ):

for ( var i in obj ) {

a_sprite[i] = obj[i]

}

But no joy... and well... has anyone been there with this one.?...


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

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

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.476 / Virus Database: 269.11.8/941 - Release Date: 07/08/2007

16:06
 


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.476 / Virus Database: 269.11.8/941 - Release Date: 07/08/2007

16:06
 
  



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

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

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

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


Re: [Flashcoders] Copying an embedded sprite

2007-08-05 Thread Ron Wheeler
You might show a small example of the code with the error. That 
sometimes gets a bit more interest than a description.


Ron

{reduxdj} wrote:
I am working on *all* actionscript project and i need help from an 
actionscript code - api sleuth.  I have a little difficulty with the 
some of the api.  I approached turning an embedded graphic asset as a 
sprite into a bitmapData object.  I hit a roadblock on copying a a 
sprite with this embedded asset into another sprite.   I tried 
casting... I tried a bunch of different ways, but got an error - 
illegal bitmapData object etc..


If you don't mind, and you can help, PLEASE post an example of how to 
do this.   I really would appreciate it.   I don't know if I missed 
something but there is no example of this scenario.  Of course, 
examples are the key for me to learn these concepts.


Thanks,
Patrick

P.S.  I am able to copy loaded content fine  - it's embedded assets 
that are the biggest challenge.


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

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



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

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


Re: [Flashcoders] mtasc and keep

2007-08-04 Thread Ron Wheeler
It is not clear why any classes are in the swf from the IDE. Can you not 
remove your classes from the fla? That will make you life simpler and 
get your code into one IDE rather than spread out over 2.


What is the error message?

Ron

Hans Wichman wrote:

Hi list,

can someone point me to a clear explanation of the -keep flag in mtasc?

The only info I can find is that -keep causes precompiled classes in the
injection swf to be kept and that this may result in some classes being
added twice, but only the first class definition will be used.

However when testing this it seems the second class definition is being used
(luckily, since it would be useless otherwise).

In addition when introducing a superclass for a class during refactoring i
*have* to recompile the swf in the IDE first otherwise mtasc will not
recognize it. Anybody know why?

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

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


  

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

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


Re: [Flashcoders] object Arrays

2007-07-26 Thread Ron Wheeler
Show the whole class definition. The compiler is pretty definite but you 
have not shown the part that it is complaining about. You are only show 
the part where it realizes that a complaint is in order. The error is 
higher up in the code.


Ron


David Ngo wrote:

Are you declaring your properties public or have public getters to access
them within your class?



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of ilteris
kaplan
Sent: Thursday, July 26, 2007 3:18 PM
To: Flash Lists
Subject: [Flashcoders] object Arrays

Hello All,

Basically I am trying to create a object which I can pass to my array  
and then access some properties of this object. Only problem is, I am  
trying to achieve this in a class.


Basically I declared my array as a class variable and then  
instantiated it in my constructor function in the class. I do have  
this function which is supposedly to create an object with certain  
properties.





private function lizPieceObj(levelup:MovieClip, lizPieceMc:MovieClip,  
masker:MovieClip, levelMasker:MovieClip) {

// build an obj to mimick 2d array.

this.levelup = levelup;
this.lizPieceMC = lizPieceMC;
this.masker = masker;
this.levelMasker = levelMasker;
}


Here is, in another function, I am trying to create this object.
	piecesArray[index] = new lizPieceObj(levelup, lizPieceMc, masker,  
levelMasker);


in order to access them later like
piecesArray[index].levelup, piecesArray[index].masker etc.

But upon compilingthe code, I do get this error. There is no property  
with the name levelup. There is no property with the name lizPiece,  
There is no property with the name masker etc.


you get the idea.
I am assuming this is something to do with scope. I am yet not sure  
how to deal with it though.

Thanks a lot.



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

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

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

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


  

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

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


Re: [Flashcoders] Searching within XML

2007-07-25 Thread Ron Wheeler

It is hardy much more work to parse the XML manually.
We did a complex search (find me all the things that a fireman might use 
for personal protection during an earthquake or what respirators are 
used by first responders or what headgear does the police marine unit 
wear) without XPath. Just travelled through the XML tree and applied the 
search criteria.
We used XML to pass the search criteria as well. Nice separation between 
the user interface (responsible for building the search criteria) and 
the search engine (responsible for applying the search criteria to the 
XML database)


It appears that this code uses XPath to find the subtree of interest and 
then navigates the subtree.
XPath certainly makes it clearer if the tree is complex with lots of 
sub-trees that are not involved in the search.

You get right to the root of the tree of interest.

Ron


Alan MacDougall wrote:

Omar Fouad wrote:
I am doing some application on flash that uses an XML file to store 
data...
This application has a search form. I understand how to get through 
the xml
by loops but i can't figure out how to get flash to know if this 
word is

included within the xml nodes or not... Any simple idea?

The steps would be something like this:

1. get all the nodes which might contain the word (probably as an array)
2. loop through the array, getting the string from each text node
3. use String.strpos to see if the word is present.

Which step is giving you trouble? My code would look something like this:

import com.xfactorstudio.xml.xpath.*;

function findInXML(rootNode:XMLNode, target:String):Boolean
{
   var nodeArray:Array = XPath.selectNodes(rootNode, xpathQuery);

   for (var i:Number = 0; i  nodeArray.length; i++)
   {
  if (nodeArray[i].nodeValue.strpos(target) != -1)
  {
 return true;
  }
   }
}

And there you go. The XPath query would be something like 
parentNode/childNode/text().


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

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



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

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


Re: [Flashcoders] Searching within XML

2007-07-25 Thread Ron Wheeler

Google??? or try guessing from the name.

Omar Fouad wrote:

com.xfactorstudio.xml.xpath??? where can i get it???

On 7/25/07, Alan MacDougall [EMAIL PROTECTED] wrote:


Omar Fouad wrote:
 I am doing some application on flash that uses an XML file to store
 data...
 This application has a search form. I understand how to get through
 the xml
 by loops but i can't figure out how to get flash to know if this
 word is
 included within the xml nodes or not... Any simple idea?
The steps would be something like this:

1. get all the nodes which might contain the word (probably as an array)
2. loop through the array, getting the string from each text node
3. use String.strpos to see if the word is present.

Which step is giving you trouble? My code would look something like 
this:


import com.xfactorstudio.xml.xpath.*;

function findInXML(rootNode:XMLNode, target:String):Boolean
{
var nodeArray:Array = XPath.selectNodes(rootNode, xpathQuery);

for (var i:Number = 0; i  nodeArray.length; i++)
{
   if (nodeArray[i].nodeValue.strpos(target) != -1)
   {
  return true;
   }
}
}

And there you go. The XPath query would be something like
parentNode/childNode/text().

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

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






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

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


Re: [Flashcoders] Backend compiled Java or scripted PHP?

2007-07-19 Thread Ron Wheeler

Eclipse, Spring, Hibernate, AXIS and Java is a pretty nice toolkit.

Ron

David Ngo wrote:

Well, in my opinion, Java is much more OOP. PHP is really nothing more than
just scripts. It will eventually hit a ceiling and be limited in what it can
do. Java, on the other hand, is much more robust, which is why the majority
of large corporations still use Java as their application backbone. But as
with anything too complex, it's also very complex to set up. Java will need
its own application container/server to run on and setting that up takes a
lot of time, money and even more effort to get it working right.

PHP on the other hand, is very easy to implement and deploy. It can be quite
powerful if used correctly and there are tons of frameworks out for PHP to
help lighten development time. I would say to look at your requirements and
see what the best fit for your needs are.

 
David



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Weldon
MacDonald
Sent: Thursday, July 19, 2007 12:01 PM
To: Flashcoders mailing list
Subject: [Flashcoders] Backend compiled Java or scripted PHP?

I've been using ActionScript for a while now, but my next project will
require a lot more server side work. In the past I've used PHP, but
only in a pidgin kind of way. alternatively, I have some Java skills,
though not specifically for the web. Either way I have to spend some
time developing an appropriate skill level, the question becomes,
which skills.

The times I've used PHP, it seemed straight forward enough, and from
what I've read Java is a little trickier to implement on the web
(correct?). On the other hand, PHP is a pretty specific niche whereas
Java has a much wider usefulness (correct?)

There are a lot of strong opinions out there.

Andreessen: PHP succeeding where Java isn't
http://news.com.com/2100-1012-5903187.html?tag=tb

and  in response,

How they can compare PHP with Java at all? (most people who are
praising PHP are either bad programmers or they are not programmers at
all)
http://news.com.com/5208-1012_3-0.html?forumID=1threadID=10712messageID=78
718start=0

PHP is faster to develop, java is faster to run, or is that runs faster?
PHP is harder to maintain, and Java has more tools ...etc...

What's a guy to beloieve? Any opin... any more opinions?
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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

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

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


  

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

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


Re: [Flashcoders] Global Error Handler

2007-07-14 Thread Ron Wheeler

I have updated the link in the Script in Action Link section.
Perhaps a more detailed description might be better.

Ron

eka wrote:

Hello :)

In my opensource framework you can use a log model and catch the 
errors with

it.

1 - Vegas page project : http://code.google.com/p/vegas/

2 - Install my framework :
http://code.google.com/p/vegas/wiki/InstallVEGASwithSVN

3 - My framework use an event model based on the W3C DOM2/3 event 
model like

AS3 event model.

http://code.google.com/p/vegas/wiki/VegasTutorialsEvents

4 - My log model use a polymorphisme with the mx.logging.* package in the
Flex SDK but you can use my library in AS2, AS3, SSAS, Javascript.

http://svn1.cvsdude.com/osflash/vegas/AS2/trunk/src/vegas/logging/

5 - To catch the errors i use my vegas.errors.* package :
http://svn1.cvsdude.com/osflash/vegas/AS2/trunk/src/vegas/errors/
This package contains the abstract class AbstractError, with this 
class you

can creates your customs exceptions.

6 - You can try the example in the repository of the project to 
understand

the mecanism of my library :

- Errors :
http://svn1.cvsdude.com/osflash/vegas/AS2/trunk/bin/test/vegas/errors/
- Logging :
http://svn1.cvsdude.com/osflash/vegas/AS2/trunk/bin/test/vegas/logging/

PS : my log model use internal or external targets to dispatch the 
logs of
the application.. you can find in my SVN repository the FlashInspector 
and

the SOS consoles :
http://svn1.cvsdude.com/osflash/vegas/AS2/trunk/tools/

EKA+ :)


2007/7/14, Hans Wichman [EMAIL PROTECTED]:


Hi,
yes I have set up some kind of global mechanism for AS2.

You can find it here
http://www.objectpainters.com/downloads/globalerrorhandler.zip

I will post information about it soon, look here for some basic info
http://objectpainters.com/blog/?p=32

Basically, its a simple RuntimeException that extends Error, so you 
still

can do 'throw new RuntimeException (...)'
You can subclass that as well for your own error types, an example is
included for Assert and AssertionFailedException.

What this class does is, you throw it, and you have to catch it and
consume
it (check the included example).
If you do not consume the error, a default error handler (your global
error
handler) will be called.

So even if you throw an error from an asynchronous call (eg the parse
method
of an xml callback) it will still be shown if you dont handle it.

HTH,
JC




On 7/14/07, dcamp [EMAIL PROTECTED] wrote:

 I was trying to figure out if there is a way to set up a global error
 handler.  This would catch all errors that will occur in a program.  I
 have tried putting the entry point in a try...catch block and also add
 listeners to the stage, but I am not able to handle reference errors.

 If anyone has attempted this or has an insight please let me know.

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

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

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

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


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

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



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

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


Re: [Flashcoders] Application Structure - FlashRemoting MovieClipLoader

2007-07-12 Thread Ron Wheeler

I recommend reading Head First Design Patterns.
The code examples are Java but the principles are universal and you get 
to see how classes can be made to work effectively.

The Singleton pattern is one of the patterns discussed.
Very entertaining approach to a serious subject.
It will save you a lot of time and make your code much smaller and more 
robust.


Ron


Sunil Jolly wrote:

I think that if you're just starting out with classes then using MVC
would be an excellent place to start since ARP could be quite
overwhelming. 


Others might disagree. :)

I've spent many hours trying to figure out how to do some seemingly
basic things in ARP and to be honest I'm still not 100% sure I'm doing
the right thing in places!

Do you know about singletons? To make your service(s) available to all
items in Flash it would be best to use it in a singleton pattern.
(http://www.flashcoder.net/blog/?p=81).

Sunil

-Original Message-

Well, the past 24 hours have been interesting to say the least.  I've
never 
really written a class, yet I know a lot about them and understand them
for 
the most part.  Before starting the project, I knew I was going to run
into 
data access issues but didn't really have a solution.  I'd never heard
of 
mvc until yesterday so thanks for pointing me in the right direction.
I'm 
confident I can start building classes using the mvc pattern, however, I


don't think I'm quite ready for something like ARP.  I think I'd be
taking 
on too much and our development resources are almost tapped.  Or should
I 
seriously reconsider using ARP, is it something I can easily implement 
later once I'm more confident with classes?



At  7/12/2007 Thursday 04:00 AM, you wrote:
  

Hi,

I would recommend ARP for this too. It's a bit tricky to use (at


first),
  

but it will keep your code clean for sure and save you a lot of time.
There's a remoting example that you could adjust quite easily.

As for the moviecliploader, I try to use a single class to do all my
loading. I guess that's what you mean by a smart loader.

Sunil
http://www.suniljolly.com

PS - Hi! I'm new to the list, I hould have joined a long time ago!

-Original Message-

Hi,

I would suggest looking at ARP or another Framework to handle your
Service calls through a single interface which you create services for.

It is well documented with examples and OS so you should be able


to
  

get the hang of it quite quickly.

osflash.org/projects/arp

HTH

Glen



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

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



  

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

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


Re: [Flashcoders] Keeping XML Objects

2007-07-05 Thread Ron Wheeler
For performance, if you have to parse it once you might as well convert 
it to objects .


I do not always follow this advice and for the most part, on a 
reasonably modern PC it really does not matter.


You do not have to use XPath. We just parse it in ActionScript in each 
getter as we need the info and once you have the pattern figured out, it 
is pretty easy.


Just make sure that you have good set of Objects even if the only 
property is an XML structure. You can always change the methods later if 
you decide to parse the XML once.


If you ever want/need to change a value at runtime, you will be much 
happier with objects.


Ron

Jer Brand wrote:

Question, and one I think I know the answer to:

If I have a configuration XML file for an app, would it be better from a
performance standpoint to keep the XML object around as my configuration
object, or to pull out the data into a custom object structure (something
simple, think object-array of objects)?

I would think that keeping the XML Object around would require more
resources -- especially if using XPath. I'm not sure how much baggage I'm
carrying around with an XML object.   On the flip side, it's a built-in
object, and if you use XPath once, you've got the classes loaded.  And it
doesn't get much easier than XPath + XML for data retrieval.

My thinking says, dump XPath, load in the XML save it's data and dump it
when done. Or dump XML all together and use a serialized object (PHP
Serializer or some such).

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

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



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

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


Re: [Flashcoders] limit of nodes of XML file that can be parsed?

2007-07-04 Thread Ron Wheeler
A side note but you might look at the Eclipse-based Reload application 
for SCORM packaging. Takes a lot of the pain out of a cumbersome process.


Ron

Danny Kodicek wrote:

  Hi Danny,
  
I'll definitely look into that, if not for this project, 
it'll come in very handy for later ones. So far I heard of 
SCORM, but never looked into it really in depth. Isn't it for 
web based learning only?



No, it's a method for packaging course data which is used by most (not quite
all) virtual learning environments / learning platforms, including the
web-based ones (eg Moodle, MS Class server) and the ones designed for use
within a school network (Kaleidos). Our content is distributed mostly on
CD-ROM too, but it's designed to be loaded easily onto a network, and we've
packaged it up as learning objects and courses using SCORM (a painful
process, I may say - SCORM is a hideous beast of a specification). Having
said that, the stuff we deliver is Shockwave, so it does work through web
pages. I'm not sure how well these things handle exes - I suspect you might
find it doesn't work so well. Still, like I say it's worth looking into: at
least in this country, most educational institutions are getting learning
platforms (indeed, secondary schools are required to get one within the next
year), so they're all looking for content. 


Danny

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

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


  

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

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


[Flashcoders] XML for course delivery

2007-07-03 Thread Ron Wheeler
I just wanted to let you know that we have a course delivery application 
that we wrote about 4 years ago in Flash using XML to control the 
delivery of material.


It uses a few XML files to control the flow.

The first is a company file that controls skinning for different 
customers (logos, colours, etc.). It also controls administrative 
behaviour that is common to all courses for that company (logon 
required, format of usernames for validation, where to find the list of 
valid users-if required, administrator's e-mail for sending out test 
results, etc.)


Each course is controlled by a chapter file that lists each chapter and 
tells the system where to find the chapter assets. This helps partition 
the course assets into manageable chunks. Our courses tend to be long 
with 2 to 5 chapters each with 30-80 slides(pages). Chapters may be 
created in parallel so it also helps keep the integrators from stepping 
on each other's toes.


The main file (pages file)  controls the delivery of content. Each slide 
(page) has a basic structure that is the same for all types of pages. 
Pages are identified as content, test - formative(immediate feedback) or 
summative (exam),  control pages(dummy pages that signal something like 
chapter end).
Simple pages look a bit like your proposed structure (except for 
duration - we get that from the sound file).


For more interesting interaction, a page can call up a template which is 
run as a sub-function and accesses its own custom datastructure which is 
stored as a sub-node under the main page node. This is used to implement 
tests (multiple choice, matching, custom flash interactions, etc.) or 
slides with timed appearance of bullets and images. This allows us to 
make courses that look like custom timeline animations just by putting 
information in XML that says at 10 seconds into the narration show this 
picture(jpg or swf), and at 15 seconds display this text in 14 point 
Arial, green and bold and at 25 second replace the image with this one.
The test templates can communicate their final test results back to the 
main flow which builds up a history that can be sent to the 
administrator at the end of the test. This returning XML structure 
includes the grade and the text that the test generated which typically 
describes what happened in a wrong answer. The main flow has no idea 
about the information, its only job is to save it and produce a final 
e-mail. The e-mail is sent through our server so that the person only 
needs HTTP access through their company firewall and does not even need 
e-mail on their PC - greatly simplifies administration; the student can 
work from work or home without .having to do any setup.


We use XML internally to pass information around between objects. XML is 
easy to parse and whole sub-nodes can be easily extracted and sent to 
another object without knowing what is in it.
This tends to make each object much simpler and less dependent on its 
friends.


It has been used for all sorts of courses in French and English. We are 
selling an Explosives Technician's pre-course that we did for the RCMP. 
It is also used by  Canadian Forces to train IEDD specialists. We have 
done a few technical courses in the petrochemical area including Pumps, 
Steam Traps, Work Permits and a ISO-14001 Awareness course. We have done 
a course on Public Participation for municipal managers and elected 
officials. It is very flexible in a wide variety of application areas.


It has proven to be extremely robust in the field running over LAN, off 
of CD-ROM and over the Internet through an LMS. It can be run as a SCORM 
compliant content. I am not a big fan of SCORM but ???


We are thinking about making it open source, if there is some interest.

We have also done another application involving a medium sized database 
stored in XML delivered on standalone CD-ROM which allowed first 
responders to quickly find information and photos about the Personal 
Protective Equipment used by all first responders in the city. (from gas 
masks to sun-screen).


We have never had any problems with XML with any recent version of Flash 
so I think that you will be OK.


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

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


Re: [Flashcoders] XML for course delivery

2007-07-03 Thread Ron Wheeler

There are 2 places that are under development so are open for anyone.
These are both setup as SCORM courses which makes for a less than fun 
experience but it is a standard.
The first is under revision so we are not as happy with the current 
contents. We did not do the instructional design and it was the first 
project for the person who did it (the subject matter expert).


1) www.iiggm.net with user default and password user.
Click on eLearning and take the only course available.
The material is pretty dry and some of the SCOs are too small. It is 
almost completely done with templates.

There are no custom animations.

2) www.edu-solution.net with user djeckyll and password mrhyde.
This is in French but you can try the course on purgeurs (steam traps).
It has both timeline animations and templated animations.

You can also see screenshots on our web site in the case study area.
Coastal was a lot of fun and has lots of fun graphics and animations.

Ron


nik crosina wrote:

Ron,

This could definitely be of interest to me and my client. Do you have
a site on-line that is using this for some touch and feel experience?

Nik

On 7/3/07, Giles Taylor [EMAIL PROTECTED] wrote:

This was set-up a while ago:
http://osflash.org/edumatic
but has been silent for a while.

Maybe your system could help inject some life back into it???

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ron
Wheeler
Sent: 03 July 2007 16:34
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] XML for course delivery

I just wanted to let you know that we have a course delivery application

that we wrote about 4 years ago in Flash using XML to control the
delivery of material.

It uses a few XML files to control the flow.

The first is a company file that controls skinning for different
customers (logos, colours, etc.). It also controls administrative
behaviour that is common to all courses for that company (logon
required, format of usernames for validation, where to find the list of
valid users-if required, administrator's e-mail for sending out test
results, etc.)

Each course is controlled by a chapter file that lists each chapter and
tells the system where to find the chapter assets. This helps partition
the course assets into manageable chunks. Our courses tend to be long
with 2 to 5 chapters each with 30-80 slides(pages). Chapters may be
created in parallel so it also helps keep the integrators from stepping
on each other's toes.

The main file (pages file)  controls the delivery of content. Each slide

(page) has a basic structure that is the same for all types of pages.
Pages are identified as content, test - formative(immediate feedback) or

summative (exam),  control pages(dummy pages that signal something like
chapter end).
Simple pages look a bit like your proposed structure (except for
duration - we get that from the sound file).

For more interesting interaction, a page can call up a template which is

run as a sub-function and accesses its own custom datastructure which is

stored as a sub-node under the main page node. This is used to implement

tests (multiple choice, matching, custom flash interactions, etc.) or
slides with timed appearance of bullets and images. This allows us to
make courses that look like custom timeline animations just by putting
information in XML that says at 10 seconds into the narration show this

picture(jpg or swf), and at 15 seconds display this text in 14 point
Arial, green and bold and at 25 second replace the image with this one.
The test templates can communicate their final test results back to the
main flow which builds up a history that can be sent to the
administrator at the end of the test. This returning XML structure
includes the grade and the text that the test generated which typically
describes what happened in a wrong answer. The main flow has no idea
about the information, its only job is to save it and produce a final
e-mail. The e-mail is sent through our server so that the person only
needs HTTP access through their company firewall and does not even need
e-mail on their PC - greatly simplifies administration; the student can
work from work or home without .having to do any setup.

We use XML internally to pass information around between objects. XML is

easy to parse and whole sub-nodes can be easily extracted and sent to
another object without knowing what is in it.
This tends to make each object much simpler and less dependent on its
friends.

It has been used for all sorts of courses in French and English. We are
selling an Explosives Technician's pre-course that we did for the RCMP.
It is also used by  Canadian Forces to train IEDD specialists. We have
done a few technical courses in the petrochemical area including Pumps,
Steam Traps, Work Permits and a ISO-14001 Awareness course. We have done

a course on Public Participation for municipal managers and elected
officials. It is very flexible in a wide variety

Re: [Flashcoders] limit of nodes of XML file that can be parsed?

2007-07-02 Thread Ron Wheeler

I do not think that you are even close to any maximum.
There are many applications much bigger than this floating about.

What tools do you have for validating XML?
We have found that XMLSpy is a really useful tool if you are doing 
anything serious with XML. It has lots of different applications that 
make XML simpler.


If you are doing serious Flash with XML, your project should be in 
Eclipse which also has excellent tools for editing and validating XML 
and can interface to XMLSpy.


We have never run into any problems with the Flash runtime  and XML 
since FlashPlayer 6.

It seems very solid and capable of handling lots of nodes.

I hope that this helps.

Ron

nik crosina wrote:

Hi,

Is there a limit on the nodes that can be parsed with in an XML file?
I am transferring an XML file that is 4 levels deep and at the moment
500 odd lines long (not even half what it will be) into a
multidimensional array and when ui trace the array, this fizzels out
not half way through.

The XML seems well formed though as I don't get any errors in any
validation tool (from dreamweaver to online sites).

Thanks!

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

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



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

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


Re: [Flashcoders] limit of nodes of XML file that can be parsed?

2007-07-02 Thread Ron Wheeler

You might also try to navigate the XML yourself (and parse it yourself.)

I would parse it into arrays of objects rather than arrays. It is a lot 
easier to ask an object for some information than a multidimensional  
array. I lot easier to maintain as well.


If you put some traces into your navigation, you will quickly see where 
the problem is.


I assume that you have looked at he last record that was parsed 
correctly and the next one that was dropped.
Do you have any characters in the XML that will cause problems (for 
example,  or )?


Ron

nik crosina wrote:

Hi,

Is there a limit on the nodes that can be parsed with in an XML file?
I am transferring an XML file that is 4 levels deep and at the moment
500 odd lines long (not even half what it will be) into a
multidimensional array and when ui trace the array, this fizzels out
not half way through.

The XML seems well formed though as I don't get any errors in any
validation tool (from dreamweaver to online sites).

Thanks!

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

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



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

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


Re: [Flashcoders] Mouse Velocity?

2007-06-21 Thread Ron Wheeler
Would you not eliminate the whole problem by keeping track of the time 
that the previous position was taken along with its coordinates and use 
that to calculate the time between the readings and divide that into the 
distance?
Then you do not care if the set interval or on enter frame come at 
equally spaced intervals.


Ron

Joshua Sera wrote:

It's indeed a setInterval problem, as the interval and
mouse movement won't necessarily match up.

onMouseMove can also be a problem, as you'll wind up
with a lot of readings going straight
up/down/right/left, rather than in the direction
you're moving.

What I've done for this problem is to average the
mouse movement over 5 or so updates to get a more
accurate reading. Demo here:

http://www.yourmomsa.com/springexp/springexp2.swf

Pick the guy up by the wheel to toss him.


--- eric e. dolecki [EMAIL PROTECTED] wrote:

  

I am calculating mouse velocity, but every now and
then you get a 0 for
velocity eventhough its not 0 (setInterval prob I
suspect).  Any better
approach?

var MouseX;
var MouseY;

function determineVelocity():Void
{
MouseX = _root._xmouse
MouseY = _root._ymouse
setTimeout( calc, 9 );
};

setInterval( determineVelocity, 20 );

function calc():Void
{
var newMouseX:Number = _root._xmouse;
var newMouseY:Number = _root._ymouse;

var deltaX = Math.abs(MouseX - newMouseX)
deltaY = Math.abs(MouseY - newMouseY)
dist = Math.sqrt((deltaX * deltaX) + (deltaY *
deltaY))
velocity = dist*31; // 31 = fps
trace( velocity );
};
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the
archive:



http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
  

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






   

Sick sense of humor? Visit Yahoo! TV's 
Comedy with an Edge to see what's on, when. 
http://tv.yahoo.com/collections/222

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

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


  

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

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


Re: [Flashcoders] Grid / Math - getting neighbouring positions

2007-06-16 Thread Ron Wheeler

It depends how you define the rings. It is by distance or by connectedness?

Is 0,0 in the second ring with 1.0 and 0,1?

What is the purpose of knowing this?

Ron

Jiri Heitlager | dadata.org wrote:

Hello list,

I have the following grid and would like to find the neighbouring 
positions of a certain point, going in a radius from in to out, 
covering all the positions.


[0,0] [1,0] [2,0] [3,0] [4,0]
[0,1] [1,1] [2,1] [3,1] [4,1]
[0,2] [1,2] [2,2] [3,2] [4,2]
[0,3] [1,3] [2,3] [3,3] [4,3]
[0,4] [1,4] [2,4] [3,4] [4,4]

Let say I take point [2,2] then its neighbours are in the first ring 
[1,1] [2,1] [3,1] [3,2] [3,3] [2,3] [1,3] [1,2]
I manage to get the first ring, but getting the other rings I haven't 
got a clue on how to do that.


Can somebody help me?

Thank you,

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

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



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

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


Re: [Flashcoders] Gaia Flash Framework Released

2007-06-12 Thread Ron Wheeler

Very neat. Nice introductory demo.

Ron

Steven Sacks wrote:

http://www.stevensacks.net/

Technology author Steven Sacks today announced the free public release 
of his Gaia Flash Framework® (gaiaflashframework.com). Gaia 
(pronounced guy-uh) is an open-source framework that provides 
powerful solutions for building Flash websites to designers and 
developers of all skill levels. Gaia dramatically reduces development 
time and is the first tool to feature a scaffolding engine for Flash.




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

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


Re: [Flashcoders] OT: Upgrading to Windows Vista

2007-06-05 Thread Ron Wheeler

Should not be too slow,
I only have 1 Vista install but it is on a notebook with only 2 GB of 
RAM and of course a much smaller and slower disk.
It is used to 3D CAD and it very snappy rendering moderately large 
models. It keeps up with the mouse when the model is being dragged or 
rotated.


Your PC sounds a bit more powerful and the disk will definitely be faster.

Ron

Paul Steven wrote:

Thanks for all the advice on upgrading to Vista. I ended up buying the
Ultimate upgrade version from PC World due to the urgency and 24 hours later
after beginning the install, and another trip to PC World to get a new
graphics card due to my old GeForce FX5200 not working with Vista, I have a
really slow PC now but at least it has Vista... Either my PC is ill or Vista
requires a beast of a machine.

My spec is

Dell Dimension 4600
Intel Pentium 4 CPU 3.06 GHZ
2.5GB RAM
250GB HD
GEForce 7600 GS 256MB AGP 


And it gets a Vista Windows Experience Index of 4.2

And boy is it running slow!!!


--
 
Paul Steven
 
Mediakitchen Limited

6 Crown Mews
Wellington
Somerset
TA21 9SZ
 
Tel: 01823 668 648
 
www.mediakitchen.co.uk
 
Mediakitchen is a limited company registered in England

and Wales. Registered number: 6134081. Registered
office: 57 Vale Road, London N4 1PP

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of nik crosina
Sent: 04 June 2007 16:22
To: flashcoders@chattyfig.figleaf.com
Subject: Re: [Flashcoders] OT: Upgrading to Windows Vista

ebuyer.com I find has reasonable prices and a good mix of versions
(including OEM).
scan.co.uk is another option.

Nik

On 6/4/07, Paul Steven [EMAIL PROTECTED] wrote:
  

I can't find anywhere to download windows vista from. Microsoft only


appear
  

to allow you to download it if you are in the US - I am in the UK..

Anyone know where I can download a copy from in the UK?

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

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





  

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

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


Re: [Flashcoders] Child Object positions

2007-06-05 Thread Ron Wheeler

Built-in or free.
You can probably find somehting to buy.

Try doing a Google to see if you can find a good tutorial

Ron


Cary Ho wrote:
Wow, flash is pretty flexible. Well, we use struts, so its java with 
servlets/jsps. Can flash use javascript? I use dwr a lot, so I wouldnt 
mind passing objects that way. Also, do i need to buy more to 
accomplish this or is it built into flash? TIA!


Merrill, Jason wrote:
I do have another question. I need my flash application to 
communicate to the servers. Its an applications that updates data 
server side. How is the accomplished in flash?
  


Many many different ways - what server side scripting is available to
you?  C#?  PHP?  JSP?  ASP? ColdFusion? Java? VBScript?
What database is available to you?  You'll need to use server-side
scripting to connect to the database.

Once you have the database and server-side scripting set up, you can use
the Flash Webservices classes, Flash Remoting, LoadVars, or
getURL()/Get/Post, etc.  - several ways in Flash - to connect to the
server-side scripts.

I've tried several of those methods in Flash and personally found
Webservices (WSDL) with C# .NET the easiest and most flexible way to
communicate with server-side scripting.  It's not the smallest packet
transfer since it's SOAP (XML format), but it's very flexible and easy
and allows for complex data types to be transferred.  The Webservice
classes will get you started, just google webservices and Flash.  Then
you need to set up a WSDL Webservice in your server-side script.

Remoting is also a good way, but I found it overly complex and somewhat
buggy at times (at least combined with ColdFusion).

Jason Merrill
Bank of America  GTO Learning  Leadership Development
eTools  Multimedia Team


 
___

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

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

  


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

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



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

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


Re: [Flashcoders] Best Practices question...

2007-06-02 Thread Ron Wheeler

It is called encapsulation.
No one should know how a class does its magic. The external classes are 
programmed to the interface (methods)(preferably to an interface class 
rather than directly to the implementation) , they are not allowed to 
peek inside.


What if you find a better way to persist the data or change your coding 
standards for variable names?


If you have allowed/encouraged others to access your classes' properties 
directly, their code will now fail to function.
How do you know who to warn or what other classes are at risk;  your 
code has no links to who calls it.


Using getters and setter for anything other than Inversion of Control is 
probably not a good thing either for the same reason and do not normally 
appear in the Interface class. If they do, you are committed to 
respecting their names as long as you support the interface.


Maybe OK to ignore encapsulation if you are a one man show building 
small demo apps but if you are building something serious with a team or 
building something that others will use and maintain you have to be careful.


It is a good practice to get into so that when you build something 
significant, you already have the coding practices that will make people 
respect your work.



Ron

Steven Sacks wrote:
And since we're talking best practices, you don't 

 have any public instance variables anyhow, hmm? :)

I don't know what best practice you're referring to that claims that 
you shouldn't have public instance variables.


The Wikipedia says NEED CITATION.

Which I will promptly ignore as rubbish.  ;)
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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



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

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


Re: [Flashcoders] class file updated, but .aso not updated?

2007-05-24 Thread Ron Wheeler

Happens all the  time on this list. Sorry I did not see your post earlier.

Tends to drive you crazy and makes you doubt your whole understanding of 
reality. The more things you change, the more things stay the same!!!


Ron

James Tu wrote:

Figured it out:


I'm using runtime shared libraries.  These are automatically imported 
in frame 1.  The classes in my movie are not exported until frame 5!


So, the version of the compiled classes that I'm getting are from the 
rsl's !!!  We're using rsl's to share assets and not code, but one 
specific rsl it also compiles some of the classes.  So, now I'm going 
into that one and just extracting the assets that will be shared.


Whew.  I'm so happy that there was a logical explanation.

-James


On May 24, 2007, at 2:54 PM, James Tu wrote:

I'm having a problem that is not directly related to a previous 
thread on this list about ASO files.


Here's my inheritance heirarchy...

BaseClass - VisualBaseClass - ButtonMessagingBaseClass - CardBase 
- CardSpecial



I'm on a Mac OSX 10.4.8 running Flash Professional v8.0.
I've updated CardBase, but the changes don't appear!  I've deleted 
ASO files and that didn't work.  I've deleted ASO files, quit Flash, 
restarted and that didn't work.


I also tried to add trace statements all the way up to the parent 
(BaseClass) and those trace statements don't appear.


The other curious bit is that I've checked Omit Trace Actions but 
the old trace statements in CardBase and the other onces all the way 
up to the parent (BaseClass) are still showing!!!



CardSpecial...the last one in the chain, behaves correctly...changes 
take effect, when I Omit Trace Action its traces are suppressed!



What's going on here?  Am I going crazy?  Is the Flash file corrupt? 
(Right now I'm going to try grabbing an older version and see how 
that behaves)


-James





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

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




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

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



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

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


Re: [Flashcoders] CVS and Flash best practice advice needed

2007-05-16 Thread Ron Wheeler
We use Eclipse with CVS and it works well. I am trying to follow as many 
of the Java best practices as I can since they have had a lot of time to 
figure out how to run complex projects with teams of people.
I am hoping that the renewed activity in the ASDT plug-in will lead to a 
strong Eclipse tool set that leverages the best practices that the Java 
community has already figured out. (Mylar in the next go-around???)


Any version control is a great help. Subversion is more modern and we 
are headed that way but CVS has worked fine for us for 5+ years of Flash 
development.


Ron

Durai Raj wrote:

SourceSafe on Windows is the only supported version control software that
integrates with the Project panel. You can use other version control
software packages with FLA documents, but not necessarily in the Project
panel.

In live documents you can check out at the link

http://livedocs.macromedia.com/flash/8/main/0377.html



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Wayne
McManus
Sent: Wednesday, May 16, 2007 4:04 PM
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] CVS and Flash best practice advice needed

Hi all,

does anyone have any thoughts or links regarding best-practice when it comes
to CVS and Flash? I'm looking into creating a repository but am unsure what
the best setup might be regarding the location of .as, .fla, .html files?

I notice Flex makes use of a bin directory; is this a good thing to
establish now for standard Flash development (does Flash CS3 remain flexible
in where you can store classes, publish to, etc)?

Any suggestions welcome, thanks (except use Subversion!; I have to use CVS
unfortunately!).
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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



DISCLAIMER:
This communication may be confidential and privileged and the views expressed 
herein may be personal and are not necessarily the views of ReDIM.
It is for the exclusive use of the intended recipient. If you are not the 
intended recipient, please note that any distribution,
copying or use of this communication or the  information in it is strictly prohibited.If you have received this communication 
in error, please notify us by email ([EMAIL PROTECTED]) and then delete the email and any copies of it.



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

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



  

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

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


Re: [Flashcoders] Strange problem with AS2 class

2007-05-13 Thread Ron Wheeler

Lots of ways for things to not work.
Where do you call the constructor? Does that get executed?
What does the code look like?



Webdevotion wrote:

Hello,

I'm working on an excisting project.
The project needed radiobuttons, so I made a radiobutton component.
It works perfectly in my stand alone test .fla, but once in the project
it just won't work.

No errors, no trace from the constructor, no exotic coding, ...

I checked export in first frame in the lib, I checked the publish 
settings

( and the class export frame ) and other things I could think off.

Does anyone have an idea what this could be ?

Thanks !

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

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



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

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


Re: [Flashcoders] Any good XML api out there?

2007-05-03 Thread Ron Wheeler
Create a Track object which has name and artist properties. Write 1 
line simple setters and getters and a constructor that takes an XML 
subtree and extracts the Track detail (This way you can add more to the 
track without having to touch anyone else.)


Create a root object that has a list of Track objects and a method 
getTrack(n) that returns the nth track.
The constructor for Root takes the XML as an argument and creates an 
array of Track Objects by passing in the sub-tree for each track when it 
finds one in the XML tree.


artistName=root.getTrack(2).getArtistName();

Very simple code. Easy to debug and maintain.

Ron

Johan Nyberg wrote:
Hi, what I need is basically a class that puts all the data in an 
associative array, or numeric, depending on if I'm storing values for 
individual nodes, or a mothernode.


Now I find there is a lot of looping going on every time I have to 
parse a XML, and XPath seems more like the thing you want to use if 
you're looking for specific data inside the XML - I just want to put 
all the data in an Array or Object...


For example:
root

track
   name/name
   artist/artist
/track

track
   name/name
   artist/artist
/track

/root

I would like it like this: root[track[n][artist]]

Regards,

/Johan


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

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


Re: [Flashcoders] drawing with mouse / pen

2007-05-02 Thread Ron Wheeler
Frustrating a user may not be new but it can be exciting if the customer 
decides its your fault.


Why not suggest something like changing the mouse into a into a hammer 
or mallet and the answers into nails or gophers. If can make the 
animation as funny as the client can stand.


Ron

Hairy Dog Digital wrote:
Just throwing my two cents worth in here... 


As others pointed out, drawing circles around selections is doable, but
isn't user-friendly. As I read through this the thought occurred to me. What
about using a drawn oval path as a movie clip for the mouse pointer that the
user clicks on a selection? This way you get the drawing selection that the
client wants, and you can control the size, spacing, position, hit test,
etc.

...Rob


-Original Message-
From: nik crosina [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 02, 2007 3:51 AM

To: flashcoders@chattyfig.figleaf.com
Subject: Re: [Flashcoders] drawing with mouse / pen

thx, rich,

funnily enuogh this echos many of my concerns. there is really no faster nd
more convenient way of making a choice then point the mouse (pen, etc) and
click.
stil figuring out what th emotivation for this request was from the client -
if they aer looking for 'just a exciting new way' of eliciting user
interaction they mght be barking up the worng tree with this idea 

nik c

On 5/2/07, Lists [EMAIL PROTECTED] wrote:
  
Nik, if it can save you any energy, be sure you show a proof of 
concept to your client/colleague before you get too hip-deep into 
this. We've tried to do similar things in the past with little 
success. The issue is not technical, it's more of a usability issue.


If you provide a VISIBLE area in which to draw, the end result will be 
that you're defeating the purpose of drawing freehand. You might as 
well just click on the area you've dedicated. (Remember, these are 
usability opinions, and your mileage may very. The crucial thing is 
that, in what you've described, your opinion typically doesn't matter. 
It's the collective opinion of your users and how well they 
understand, and can complete, the task that matters.)


If you want to draw anywhere, you can create an empty movie clip as a 
canvas that allows you to draw over everything and, as you said, do a 
stroke with no fill so you don't have to worry about closing the path, 
and it looks more natural like a marker on a whiteboard. You can just 
use lineTo and an interval if you want something simple, or smooth out 
the line using curveTo and an interval. You can then determine the 
geographical center of the circle and see if that coordinate matches 
up with a hitTest on the answer clip. You can't use hit test between 
circle and answer unless the answers are no where near each other. 
But, you can say: center of circle is at 100,100, and 
answerMC.hitTest(100,100,false) (No shape flag will be easier, I 
think.)


The problem will be one of user satisfaction. How hard is it to draw a 
circle with the mouse? How accurately can they get it over the answer? 
How many times do they have to do it? For example, doing this for a 
five-question quiz is great. But for a 20 question quiz it is 
unbearably tedious. You want to just click the answer and move on.


Anyway, I suggest that you spend a little time with testers to see how 
they react before committing.


Rich



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

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






  

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

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


Re: [Flashcoders] factory with varying numbers of params

2007-05-02 Thread Ron Wheeler

Looks like a Decorator Pattern.

Danny Kodicek wrote:
  Thanks a lot for all the replies. Most helpful. It's a funny 
  
situation. I'm using a deserialised XML file to dictate the 
content and layout of each page. A page might contain 1. A 
heading, 2. A TextField 3. A link or it might contain 1.A 
heading 2. A thumbnailMenu or various other permutations.
I have written a class for each item that implements an IItem 
interface, and they all have certain identical methods 
(setPosition(), setScheme(), close() etc), but they also have 
unique props that need to be set (The label of the header, 
the label / path of a link etc.) Also to comlicate things, if 
the item is a menu, I need to attach an eventListener.


I like the idea of using classes to encapsulate the 
parameters, but where would these be created? I guess it 
would make sense to do it at deserialisation, but then that 
gives two places that will be subject to change and that is a 
bad thing. I could do it in a separate method in the factory 
I suppose.



This sounds like what I'm doing at the moment. What I did was instead of
using an interface, to make all my elements inherit the same base Element
class, then when running a createElement function, I simply defined it as
returning an instance of Element. It sounds to me like you're giving in to a
common problem of letting the OO cart pull the design horse - you're trying
to force a function to be strongly typed when by design it's creating
elements of different types.

Danny


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

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


  

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

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


Re: [Flashcoders] AS2: generating new instances dynamically?

2007-05-01 Thread Ron Wheeler
I am not sure if you are showing all the code but in your code fragment, 
newPost is a local variable that will be destroyed as soon as createPost 
ends. A short and brutal life.


It needs to be a class property and you will want to have a getter to 
access it.


Ron

sebastian chedal wrote:

Hello Flashcoders,

Sorry to bother you with another simple AS2 questions, I'm making good
progress but I am stumped with one simple thing.

I have one class/object that I want to use to generate copies 
[instances] of

another class.

The second class is an object in the library with an ID and an assosiated
*.as file [in the linkage panel].

The code is:
=

//PostModel.as

import com.blabla.PostView;

class com.blabla.PostModel {

  public function createPost (__id) {
   var newPost = new PostView (__id);
  }
}

=

When I run this code, the class doesn't construct an instance...

What am I missing? If I need to call the Library Identifyer instead, how
would I do that?

I don't want to attach the PostView to the PostModel class, I just 
want to
create instances of them and attach them to _root [or some other MC in 
the

timeline].

Thanks!!

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

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



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

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


Re: [Flashcoders] rotate a cube

2007-05-01 Thread Ron Wheeler

Why not Sandy3D ???

Waseem Shahzad wrote:

Hello Flashcoders

I am trying to rotate a cube which i made in the flash authoring
environment. However it is not a real cube but I don't want to use API to
make a cube first and then rotate it. I want that a cube which have a
specific design then it is rotate in the 3d environment using flash
Actionscript.

Please help me I don't find any solution and now i think that might be 
it is

not possible to rotate such type of cube.

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

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



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

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


Re: [Flashcoders] Re: OOP: design patterns: multiple MVCs?

2007-04-30 Thread Ron Wheeler
I am using ArgoUML which is open source (www.tigris.org) but the 
diagrams are not nearly as attractive.


Ron

sebastian wrote:

Hi Ron!

Thanks for the advice, I think I solved it by removing the 2 MCV's and 
just making nested classes within the view.


http://www.chedal.org/temp/uml_idea_02.png

State machines are quite interesting, and I think I'll use that form 
of logic with switch-case statements inside of the PageBuilder class. 
Thanks for the reference!


The program I am using for the charts is OmniGraffle, which I think is 
Mac only.

:P

With kind,

Sebastian.

Ron Wheeler wrote:

Nice diagram ;-)

could be designed with several Model-View-Controller rings in it

Without getting too deep into your application, it looks like might 
want to think about a Controller with set of nested state machines 
inside.
 From what you wrote, it seems that this is where you are headed 
without using the words State machine.
If you can take a look at a State Machine Design Pattern, you will 
likely find the ideas that you need to implement, elegantly laid out


We have done this is a complex ActionScript application and the State 
machine in the Controller really simplified how we thought about the 
Controller and eventually the implementation was fairly 
straightforward and has survived a few years of maintenance and 
improvements without collapsing or requiring major rewrites to handle 
new functionality. Adding new states is easy and usually has no 
impact on existing state (just the transition routes).


The control functions inside each state override the defaults 
(Interface methods)  and impose their own behaviour. If you press 
next in Starting of Chapter state, you get different behaviour 
than you do when you press Next in Administering Test state. 
(Ours is an eLearning delivery system).
The top level of the controller only has to manage its state and make 
sure that event is dispatched to the current state object. When the 
controller starts, it builds its state engine(instantiates the state 
objects), sets up the View, sets the initial state and waits.



I hope that this helps.

Ron


sebastian wrote:
In case it makes more sense to look at a diagram, here is my [still 
in progress] UML overview of the application:

:-P

http://www.chedal.org/temp/uml_idea.png

with kind,

seb.

sebastian chedal wrote:

Hello folks,

I have a design question, the application I am building could be 
designed with several Model-View-Controller rings in it. But I am 
not sure what would be the best practice to connect them 
together... or if MVC is even the best way to go?


In a nut shell here is what my application does:

An 3D interface moves with the mouse around the screen. When you 
click on an item, it expands to show you some info [sometimes an 
flv]. If you click on more info button, you zoom into the 3D 
navigation item and the flash view pane gets filled exclusively 
with information about this navigation item.


Each navigation item has different modules of information compared 
to other navigation items, and inside each module is content. There 
are possibly sub pages underneath each navigation page. Naturally 
you can close the page and go back to the main 3D navigation at any 
time.


Now where I am unsure about my UML OO design is in the approach of 
the module-templates, and whether I should use multiple M-V-C 
circles. I will be implementing SWFAddress [for deeplinks] and 
Stats, so an overall event manager [Observer] is essential.


Logically I would imagine just 3 [nested] classes for the templates:

Page-Module(s)-Content(s)
[there can be multiple modules per page loaded dynamically and 
multiple content item types loaded per module: button, text, flv 
players etc.]


but if I break 'Page' into an MCV chain I would get:

SWFAdress-PageController-PageModel-PageView
[Page Controller also sends data to StatsCollectorClass for updates]

And then another chain for the modules:

?ModuleController-ModuleModel-ModuleView

And then I presume the content would then be loaded/attached by the 
'ModuleView'


My questions are:

1. Should I bother with an MCV layout? [the application needs to 
built for long term use/expansion] Or just group the pages and 
modules together into one class each?
2. If I do split them into separate classes, where is the point of 
connection between two MCV chains? Is it from the parent model to 
the child's controller? Or from the parent's controller to the 
child's controller?


Thanks for your insight!

Sebastian.


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

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



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search

Re: [Flashcoders] compare Objects

2007-04-30 Thread Ron Wheeler
It is more reasonable to include a method in the class to compare itself 
to another instance of itself.


x= new myObj(1,2,3)
y=new MyObj(1,2,4)
trace (x.isequal(y))

Ron

Gilles Roquefeuil wrote:

Hello,

seems trivialo, but is there a simpler way to compare two identically 
formed objects than recursively compare their props (and types and 
values of their props)?


var obj1:Object = {a:0,b:1,c:[0,1,2],d:[{x:0,y:10},{x:10,y:0}]}
var obj2:Object = {a:0,b:1,c:[0,1,2],d:[{x:0,y:10},{x:10,y:0}]}
trace (obj1==obj2) returns false...

Thanx,

Gilles

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

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



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

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


Re: [Flashcoders] compare Objects

2007-04-30 Thread Ron Wheeler


Fix a small typo

It is more reasonable to include a method in the class to compare itself
to another instance of itself.

x= new MyObj(1,2,3)
y=new MyObj(1,2,4)
trace (x.isequal(y))

Ron

Gilles Roquefeuil wrote:

Hello,

seems trivialo, but is there a simpler way to compare two identically 
formed objects than recursively compare their props (and types and 
values of their props)?


var obj1:Object = {a:0,b:1,c:[0,1,2],d:[{x:0,y:10},{x:10,y:0}]}
var obj2:Object = {a:0,b:1,c:[0,1,2],d:[{x:0,y:10},{x:10,y:0}]}
trace (obj1==obj2) returns false...

Thanx,

Gilles

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

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




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

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


Re: [Flashcoders] flowcharting

2007-04-28 Thread Ron Wheeler

Free at last, free at last!
No more MS-Office.

Ron

nik crosina wrote:

Looked at openoffice and fell in love!

Thanks, Ron!!

Have a nice weekend,

Nik

On 4/27/07, Ron Wheeler [EMAIL PROTECTED] wrote:

OpenOffice has a nice drawing tool with all of the flowcharting symbols
defined. www.openoffice.org
You can colour and shade them to your hearts content.

I built a flowcharting add-on to Compendium www.compendiuminstitute.org
http://www.compendiuminstitute.org/community/bpa.html is a link to a
case study on what I did.
This adds flowcharting to the functionality of Compndium which is a
great tool for all kinds of knowledge management and presentation.

ArgoUML is a free UML modelling package which is also pretty useful (Use
Cases, Class Diagrams, Sequence Diagrams, State Diagrams, etc.)

Ron

nik crosina wrote:
 Hi guys,

 Does any of you use flow charting to map out
 projects/screens/functionality? If so - what are you using to draw
 them. I don't have excel which I used before and am looking for some
 shareware or other small but beautifully formed solution.

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

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





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

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


Re: [Flashcoders] Re: OOP: design patterns: multiple MVCs?

2007-04-28 Thread Ron Wheeler

Nice diagram ;-)

could be designed with several Model-View-Controller rings in it

Without getting too deep into your application, it looks like might want 
to think about a Controller with set of nested state machines inside.
From what you wrote, it seems that this is where you are headed without 
using the words State machine.
If you can take a look at a State Machine Design Pattern, you will 
likely find the ideas that you need to implement, elegantly laid out


We have done this is a complex ActionScript application and the State 
machine in the Controller really simplified how we thought about the 
Controller and eventually the implementation was fairly straightforward 
and has survived a few years of maintenance and improvements without 
collapsing or requiring major rewrites to handle new functionality. 
Adding new states is easy and usually has no impact on existing state 
(just the transition routes).


The control functions inside each state override the defaults (Interface 
methods)  and impose their own behaviour. If you press next in 
Starting of Chapter state, you get different behaviour than you do 
when you press Next in Administering Test state. (Ours is an 
eLearning delivery system).
The top level of the controller only has to manage its state and make 
sure that event is dispatched to the current state object. When the 
controller starts, it builds its state engine(instantiates the state 
objects), sets up the View, sets the initial state and waits.



I hope that this helps.

Ron


sebastian wrote:
In case it makes more sense to look at a diagram, here is my [still in 
progress] UML overview of the application:

:-P

http://www.chedal.org/temp/uml_idea.png

with kind,

seb.

sebastian chedal wrote:

Hello folks,

I have a design question, the application I am building could be 
designed with several Model-View-Controller rings in it. But I am 
not sure what would be the best practice to connect them together... 
or if MVC is even the best way to go?


In a nut shell here is what my application does:

An 3D interface moves with the mouse around the screen. When you 
click on an item, it expands to show you some info [sometimes an 
flv]. If you click on more info button, you zoom into the 3D 
navigation item and the flash view pane gets filled exclusively with 
information about this navigation item.


Each navigation item has different modules of information compared to 
other navigation items, and inside each module is content. There are 
possibly sub pages underneath each navigation page. Naturally you can 
close the page and go back to the main 3D navigation at any time.


Now where I am unsure about my UML OO design is in the approach of 
the module-templates, and whether I should use multiple M-V-C 
circles. I will be implementing SWFAddress [for deeplinks] and Stats, 
so an overall event manager [Observer] is essential.


Logically I would imagine just 3 [nested] classes for the templates:

Page-Module(s)-Content(s)
[there can be multiple modules per page loaded dynamically and 
multiple content item types loaded per module: button, text, flv 
players etc.]


but if I break 'Page' into an MCV chain I would get:

SWFAdress-PageController-PageModel-PageView
[Page Controller also sends data to StatsCollectorClass for updates]

And then another chain for the modules:

?ModuleController-ModuleModel-ModuleView

And then I presume the content would then be loaded/attached by the 
'ModuleView'


My questions are:

1. Should I bother with an MCV layout? [the application needs to 
built for long term use/expansion] Or just group the pages and 
modules together into one class each?
2. If I do split them into separate classes, where is the point of 
connection between two MCV chains? Is it from the parent model to the 
child's controller? Or from the parent's controller to the child's 
controller?


Thanks for your insight!

Sebastian.


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

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



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

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


Re: [Flashcoders] flowcharting

2007-04-27 Thread Ron Wheeler
OpenOffice has a nice drawing tool with all of the flowcharting symbols 
defined. www.openoffice.org

You can colour and shade them to your hearts content.

I built a flowcharting add-on to Compendium www.compendiuminstitute.org
http://www.compendiuminstitute.org/community/bpa.html is a link to a 
case study on what I did.
This adds flowcharting to the functionality of Compndium which is a 
great tool for all kinds of knowledge management and presentation.


ArgoUML is a free UML modelling package which is also pretty useful (Use 
Cases, Class Diagrams, Sequence Diagrams, State Diagrams, etc.)


Ron

nik crosina wrote:

Hi guys,

Does any of you use flow charting to map out
projects/screens/functionality? If so - what are you using to draw
them. I don't have excel which I used before and am looking for some
shareware or other small but beautifully formed solution.


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

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


Re: [Flashcoders] AS2.0 Question - passing data between classes

2007-04-24 Thread Ron Wheeler
You might want to read Head First Design Patterns for some good ideas 
about how to write good code.
Lots of practical ideas about many of te situations that you need to 
resolve.


Ron

Andrew wrote:

Hi

I'm new to OOP programming in AS2.

I'm writing two classes right now. One which creates/manipulates an 
array of XMLNodes and one which watches for an internet connection. 
When it finds a connection, it starts to send the XMLNodes from the 
queue back to a server one by one.


So far I've written the Queue class.

class com.Queue {
private var _milestoneXMLNode:XMLNode;
private var _aQueue:Array;
//Constructor
public function Queue() {
_aQueue = new Array();
}
//Methods
public function addMilestoneToQueue(milestoneXMLNode:XMLNode):Void {
_aQueue.push(milestoneXMLNode);
}
private function getQueue():Array {
return _aQueue;
}
private function getFirstMessageInQueue():XMLNode {
return _aQueue[0];
}
private function deleteFirstMessageFromQueue():Void {
_aQueue.splice(0,1)
}
}

Now the real question I have is how to get the first element from the 
Queue, i.e. _aQueue[0] from the Queue class into the Connection class 
so that it can be sent back to the server?


class com.Connection {
private var _isConnection:Boolean;
//Constructor
public function Connection() {
//No connection by default
_isConnection = false;
}
//Methods
private function detectConnection():Void {
//
}

}

How do I do this? Or does this break encapsulation? I'm a bit stuck, 
would appreciate any advice.


Cheers
Andrew


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

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



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

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


  1   2   3   4   >