Posts Tagged ‘flash’

Sprouts

June 26, 2008

Whilst searching for information about MTASC Commands I came across site the Sprouts site. An ‘an open-source, cross-platform project generation and configuration tool for ActionScript 2, ActionScript 3′…. As I’ve been looking at Ruby using the OSX Terminal and am interested in further experiments in finding new an better ways to compile and build swfs I thought I would investigate, and create another project.

Project Aims:

1. Create a Sprout to compile AS2 Flash to a swf using MTASC.

2. As above with SWFMill

The Project uses:

1. Mac OSX 10.4.11

2. Flash 8

3. AS2

4. Ruby ruby 1.8.6 (Once updated)

5. RubyGems

6. OSX Terminal (I’m using the $ symbol to denote input into the Terminal Window, ie type what’s after the $ glyph).

Tasks

1. Ascertain which version of ruby is installed. In the Terminal type:

$ ruby -v

which for me outputs:

ruby 1.8.2 (2004-12-25) [universal-darwin8.0]

2. Update Ruby. The latest version is

ruby 1.8.6

so if current version is less you need to update. I used the Ruby One-Click Installer for OSX. Downloaded and unpacked in the Terminal, opened a fresh Terminal window and typed in the Terminal:

$ ruby -v

The output is now:

ruby 1.8.6 (2007-03-13 patchlevel 0) [universal-darwin8.0]

3. Install RubyGems.

Down load and unpack. ( I put the ‘rubygems-1.2.0′ folder in Applications.)

4. Install Rails.
In the Terminal Window:

$ sudo gem install rail

Enter password if prompted. My Terminal output was:

Bulk updating Gem source index for: http://gems.rubyforge.org
ERROR: While executing gem … (Gem::GemNotFoundException)
Could not find rails (> 0) in any repository

(I’m not 100% sure if everything was OK here, or if this step was necessary, so I’ll have to make some further investigations.)

5. Install the sprout gem. Enter in the terminal:

$ sudo gem install sprout

The Terminal Output was:

Bulk updating Gem source index for: http://gems.rubyforge.org
Select which gem to install for your platform (universal-darwin8.0)
1. sprout 0.7.183 (ruby)
2. sprout 0.7.183 (darwin)
3. sprout 0.7.183 (mswin32)
4. sprout 0.7.183 (x86-linux)
5. Skip this gem
6. Cancel installation

Just guessing entered:

$ 1

A whole load of other options followed such as:

Install required dependency rubyzip? [Yn]

I entered Y for all of them.

Various outputs followed for example:

Successfully installed sprout-0.7.183
Successfully installed rubyzip-0.9.1
Successfully installed archive-tar-minitar-0.5.2
Successfully installed rails-2.1.0
Successfully installed rake-0.8.1
……

So I assumed the correct applications have been successfully installed.

6. Instructions for downloading the Sprouts AS2 Bundle see: ActionScript 2.0 Bundle

For example in the Terminal

cd

to an appropriate folder and enter:

$ sprout -n as2 SomeProject

7. Launch Rake

$ rake

Had some problems tried, output:

rake aborted!
no such file to load — open4

I was getting a message:

sudo gem install open4

8. Sort out Rake problem
Found some advice here: projectsprouts

Enter in the Terminal:

$ sudo gem install open4

Then after a whole load of output:

sudo gem install rb-appscript

9. Launch Rake again

$ rake

After another string of output, the Flash Player launched with the png of the Sprout logo!

Picture 1.png

Conclusion:

The project first aim …compile AS2 Flash to a swf… has been realised, I’ll create further posts to detail further experiments.

Flash Bloggers

June 20, 2008

Searching the Web I’ve come across many good Flash Blogs which I will Document here:

Lee Brimelow’s blog, TheFlashBlog, also the author of gotoAndLearn tutorials.

automatalabs

Pixelfumes a Pittsburgh-based multimedia solutions company. They have also provided articles for the Adobe devnet site.

Mike Chambers

Razorberry. There are some good AS2 and AS3 functions on the Blog, for instance Colour utility methods, and AS3 Dynamic Speech Bubble Snippet.

ActionScript CodeSnippets

June 20, 2008

I was looking for some good Flash programming articles to add to by post Flash Programming - Good Articles, and came across Jim Bumgardner’s blog, which in turn led me to this solution he posted to the FlashKit forum 2-State Button.

In the examples he uses the XOR operator: ^
and the conditional operator: ?:

I’ve never been a fan of the conditional operator as the code to me, although succinct does not seem as clear as using if and else. To add to the confusion the operation is also known as Ternary operator. See the wikepedia definition Ternary_operation.
I’ll add the code from Flash help as a reference:
var timecode:String = (new Date().getHours() < 11) ? “AM” : “PM”;
trace(timecode);

The XOR operator seems like fun, although I’ve never found an instance where I could use it!

Flash Programming - Good Articles

June 20, 2008

I’m compiling a collection of links to good Flash Programming articles, I’ll add some more details soon.

Explaining OOP without Mentioning Classes

I’m currently documenting a Flash project and whilst I was looking for precise definitions of Programming terms came across a definition of the Law of Demeter. This is (t)he fundamental notion is that a given object should assume as little as possible about the structure or properties of anything else… This is something I’ve been attempting to do without having a name for it for some time, i.e.. a Class should know as little as possible.

To quote again from this article a point pertinent to ActionScript: In particular, an object should avoid invoking methods of a member object returned by another method. For many modern object oriented languages that use a dot as field identifier, the law can be stated simply as “use only one dot”. That is, the code “a.b.Method()” breaks the law where “a.Method()” does not.

There is a good example explaining the Law of Demeter using Ruby see: Misunderstanding the Law of Demeter.

papervision

May 5, 2008

I’ve recently worked on a couple of Papervision3d sites.

Below is a list of links I’ve found useful:

papervision3d.org

papervision2 which has excellent tutorials.