Mittwoch, 31. Dezember 2008

The Future is Here, The Future is Now


"The Future is Here, The Future is Now" is a song that T.H. Culhane and Frank DiMassa created for their renewable energy educational campaigns. The song was taken on the road by the Circus Guy Musical Goodwill Ambassador program (performed by T.H., Mike and Andrew Culhane, Anais Mitchell, Ted Stern, Greg Ross, James Dean Conklin and Frank Marino) and performed in a series of solar and wind powered concerts at the Wadi Environmental Science Center in Egypt and throughout the country with the U.S. State Department Cultural Affairs Program. It was then performed in Kuwait during a series of tours that culminated with its performance for the Sabah family children (kids of the oil sheikhs) and their classmates in the Imax Theatre at the Kuwati Science Center. It was recently performed on KPFK radio's "Healthy Me, Healthy Planet" hosted by Sherry Beale.







The Future is Here
Words and Music copyright 2004 T.H. Culhane, Melodic-Mnemonics


(Starts with conga drums with implied D7 as fifth of the key, bass note descends E D, B A, G into a Gmaj7)
Spoken:
(Gmaj7) “Every day we live our lives oblivious to the  ( Gmaj6) deleterious effects of our actions,
as we (Em9) unwittingly and indiscriminately burn gas and oil (Em7) in our internal combustion engines, turbines and boilers.
(Am6) But the bell is tolling for these irresponsibly ( Am7) inefficient and unhealthy technologies,
and it is time we heeded the call of our mother earth…
(D7) ‘The stone age did not end because we ran out of stones’”… (D7b9)

(C7 with descending bass line)
Hey!
(G7 with descending bass line)
Check it out!
(C7 with ascending bass line)
I want to tell you about it!
(G7 with 1 5 8 arpeggio).


Because the (C7) future is (G7) here
Because the (C7) future is (G7) NOW
Because a (C7) few things are (G7) clear
No need to (Am) fear… (A7)
Just watch the (Bb) bad times disappear (D7)

Because the (C7) future is (G7)  wind
Because the (C7) future’s the (G7) sun
Because the (C7) future is (G7) green
The future’s (A7) clean
And there’s (Bb) enough for everyone… (D7)

Since (G7) Time Immemorial…
The Earth’s been making coal an oil
(C7) Sunshine stored in wood and fossil fuels
(G7) We’ve been dipping in the past, for energy that will not last.
(C7) An alien would think that we are fools
(G7) Cause all along we’ve had the choice
To use the sun sustainably
(C7) And make a brighter future for us all
(G7) We now have the technology
To free us from dependency
(C7) And wean us from the grip of foreign oil


Because the (C7) future is (G7) here
Because the (C7) future is (G7) NOW
Because a (C7) few things are (G7)  clear
No need to (A7) fear…
Just watch the (Bb) bad times disappear (D7)


(G7) Carbon was the enemy
an element in you and me
(C7) Sequestered by the flowers and the trees
But (G7) burned, it makes a mess of things
And a host of new carcinogens,
and (C7) all the global warming that we see
(G7) The future should be carbon-free
With new clean forms of energy
Like (C7) Hydrogen and Boro-Hydride Salts
(G7) Micro-Hydro, Wind and Sea
Geothermal and PV
You’ll (C7) see we don’t need carbon fuels at all.


(Eb7)Take a joy ride on the Hydrogen (Bbm) Highway
(Eb7) Check out all the wind farms by the (Bbm) road
A (Eb7) million solar roofs around the (Bbm) country
Are (F#7) shaving costs and handling peak (F7) loads…

(F#) We’ve got the power…
(Bbm) Tremendous power…
(F#) Plenty of power…
(Bbm) Clean and Green Power
There’ll (Dmaj7) never be a crisis here again… (D7)


(C7 with descending bass line)
Hey!
(G7 with descending bass line)
Check it out!
(C7 with ascending bass line)
                 I  like a clean future
                     (G7)
             That’ what I’m talkin’ about!

We DON’T (G7) NEED atomic plants, sir
Fuel Cells are the answer
(C7) They produce only pure water with their kilojoules
(G7) Screw the radiation and runaway inflation
(C7) Everyone can make their own clean fuel
By (G7) electrolyzing water, using sunlight and wind power
(C7) You can make your hydrogen in your own home
And (G7)  how to store the hydrogen? This has been the problem
But in (C7) fact we’ve had the answer all along
(G7) A liquid soap solution
That can clean up our pollution
(C7) It’s detergent, yes,
It’s BORAX, and it’s clean
(G7) It comes from desert sands
Produces H2 on demand
It can (C7) create the Hydrogen Economy (D7)

                      (D7b9! D7b9!  D7b9!)

Because the (C7)  future is (G7) here
Because the (C7) future’s the (G7) sun
Because the (C7) future is (G7) green
The future’s (A7) clean…
And there’s (Bb) enough for everyone (D7)
Shine on! (G)




Lyrics only:

The Future is Here
Words and Music copyright 2004 T.H. Culhane, Melodic-Mnemonics

Spoken:
“Every day we live our lives oblivious to the deleterious effects of our actions,
as we unwittingly and indiscriminately burn gas and oil in our internal combustion engines, turbines and boilers.
But the bell is tolling for these irresponsibly inefficient and unhealthy technologies,
and it is time we heeded the call of our mother earth…
‘The stone age did not end because we ran out of stones’”…


Because the future is here
Because the future is NOW
Because a few things are clear
No need to fear…
Just watch the bad times disappear

Because the future is wind
Because the future’s the sun
Because the future is green
The future’s clean
And there’s enough for everyone…

Since Time Immemorial…
The Earth’s been making coal an oil
Sunshine stored in wood and fossil fuels
We’ve been dipping in the past, for energy that will not last.
An alien would think that we are fools
Cause all along we’ve had the choice
To use the sun sustainably
And make a brighter future for us all
We now have the technology
To free us from dependency
And wean us from the grip of foreign oil


Because the future is here
Because the future is NOW
Because a few things are clear
No need to fear…
Just watch the bad times disappear


Carbon was the enemy an element in you and me
Sequestered by the flowers and the trees
But burned, it makes a mess of things
And a host of new carcinogens,
and all the global warming that we see
The future should be carbon-free
With new clean forms of energy
Like Hydrogen and Boro-Hydride Salts
Micro-Hydro, Wind and Sea
Geothermal and PV
You’ll see we don’t need carbon fuels at all.


Take a joy ride on the Hydrogen Highway
Check out all the wind farms by the road
A million solar roofs around the country
Are shaving costs and handling peak loads…

We’ve got the power…
Tremendous power…
Plenty of power…
Clean and Green Power
There’ll never be a crisis here again…


We DON’T NEED atomic plants, sir
Fuel Cells are the answer
They produce only pure water with their kilojoules
Screw the radiation and runaway inflation
Everyone can make their own clean fuel
By electrolyzing water, using sunlight and wind power
You can make your hydrogen in your own home
And how to store the hydrogen? This has been the problem
But in fact we’ve had the answer all along
A liquid soap solution
That can clean up our pollution
It’s detergent, yes,
It’s BORAX, and it’s clean
It comes from desert sands
Produces H2 on demand
It can create the Hydrogen Economy

Because the future is here
Because the future’s the sun
Because the future is green
The future’s clean…
And there’s enough for everyone
Shine on!

Dienstag, 18. November 2008

"Our Father", The Lord's Prayer

 I used to attend the Santa Monica Church in Los Angeles and heard a version of Our Lord's Prayer that had this basic melody and chords at the beginning. It enchanted me.   I can't find a recording of it anywhere. So I've sketched out here what I remember, with some of my own embellishments  up until "And forgive us our trespasses" at which point I'm freestyling with my own chords and interpretation. But I think it makes a nice melodic-mnemonic for learning the Our Father.  (My apologies to the original composers of the melody and chords.)

                (G)                                             (Em)                
2.1 "Our Father,  ( "Our Father)  who art in Heaven" ( who art in Heaven")
           (C)      (Am)       (F)    (D7)
2.2 "Hallowed be thy Name" 

                (G)
2.3 "Thy kingdom come" (Thy kingdom come)

              (Em)                                         (C)           (Cm) (D7)  (G)
2.4 "Thy will be done, (Thy will be done)on earth as it is in heaven"


          (Gmaj7)                                                                      (Em7)
2.5 "Give us this day our daily bread" (Give us this day our daily bread)

                (C)                     (D)                       
2.6 "And forgive us our trespasses,,,,,,,,,,,,,,, 
 (Bm)                                (Em)                     (F)  (D7)
as we forgive those  that trespass.....     against us"........
               (G)                                               (Em)
2.7 "And lead us not (and lead us not)  into temptation"
               (C)                  
 2.8 "But deliver us from evil" (Lord deliver us from evil),,,

    (A7)                                                                                        
2.9 "For thine is the kingdom, (For thine is the kingdom) 
              (C)               (Cm)  
and the power, and the glory,
        (Am)    (D7)   (Eb)     (Cm/F) (G)
for ever and ever. Amen "

Donnerstag, 13. November 2008

Tools for flash

 I wanted to be able to create an animation in Flash MX 2004 where the sun rises and sets over a graph showing TOU (Time of Use).  To guide the animation I wanted to draw an arc as a path.  But the pen tool doesn't seem to work like it does in photshop, so for the life of me I couldn't figure out how to do it.

Fortunately, Ric Ewing over at Adobe created some free Action Script Tools that will do the trick and posted them for all of us free to use here:

http://www.adobe.com/devnet/flash/articles/adv_draw_methods.html

 To create the sun:

From http://www.axialis.com/tutorials/tutorial-misc001.html

Create a Transparent Image using Adobe PhotoShop®

 To be able to duplicate layers and delete empty frames these Macromedia Flash Extensions are key (note you have to download Macromedia Extension Manager 1.6 for Flash MX 2004).
http://www.flashguru.co.uk/category/flash/extensions

Dienstag, 11. November 2008

Building a dynamic tool for input of solar energy economic variables

I've always been inspired by SimCity and The Sims, and wondered how we could use these "games" for more important work -- particularly the design of "Solar Cities". Inspired by the folks at Digital Urban, I tried my hand at building a virtual Egyptian Darb Al Ahmar community in the "Oblivion" Game Engine and then placing solar panels on a couple of the roofs there.

You can see my results below:




and

.

I also tried my hand at using Google Sketchup to create a tutorial for how to adjust our solar hot water system on the Zabaleen school in Muqattam:




Then I discovered Metroquest , the first serious SimCity oriented planning tool.



While it isn't a 3D virtual reality tool, it does a great job of helping planners create future scenarios for evaluation by stakeholders. There are fascinating examples of its use in Yellowknife
and Niagra that you can work through to see how effective the tool is.

The question now is, how do we develop a similar tool for Solar CITIES?

Flash MX may hold part of the answer, so we will start here.

One of the great features of MetroQuest is their use of sliders as input mechanisms. I have long argued (and most recently do so in my Ph.D. thesis) that urban planning should be like mixing a song, working to achieve a harmonious balance of all the elements that make living in cities worthwhile and desirable. My postmodern professor Ed Soja at UCLA, author of "Thirdspace", challenged us to move beyond the binary logic of "either/or" and into the hybridity friendly thirdspace of "both-and". But he cautioned that both-and was not liscence to simply mash everything up.

Coming from a music industry background, I was always comfortable with both-and, finding that the way to achieve beauty was through the proper mix. I have worked on enough mixing boards over the years to appreciate the subtlety and importance of "faders", tweaking the amount of bass and drums and synth pads and vocals until something great came out of the mix.

So when developing a tool to help calculate the costs and infrastructure parameters of effective solar energy set-ups, I knew one of the first tasks I would have to undertake would be figuring out how to create and use faders in Flash.

Fortunately, http://www.maximized.co.uk/flashintro/slider1.html has a great little tutorial with the necessary code in it.

I'll reproduce the code here; for the tutorial click the link above.









  • Open this Button Movie Clip for editing, select the button symbol that is embedded in it, then add the following Actionscript code to the button:







    on (press) {
    startDrag("", false, left, top, right, bottom);
    dragging = true;
    }
    
    on (release, releaseOutside) {
    stopDrag();
    dragging = false;
    }
    














  • Go back to the main Timeline and select the Button Movie Clip. Add the following Actionscript code to the Button Movie Clip:







    onClipEvent (load) {
    top = _y;
    bottom = top + 100;
    left = _x;
    right = _x;
    }
    
    onClipEvent (enterFrame) {
    if (dragging == true) {
    // execute this code
    }
    }
    
    



    They say at the end of the tutorial: " To get the button to do something, look back at the second section of code you added - any code you place in the section marked // execute this code will be executed while the slider is being dragged.
    One thing you should try is to use the slider to control the volume of a music clip. Create a sound object and set it to play continuously. Add a slider to your Flash movie and add code so that it will alter the volume of the sound when it is dragged. Hint: the slider can move up and down in a range of 100 pixels. Sound volume has a range of zero (lowest volume) to 100 (highest volume)."


    So that is a great start!

    But if you are a non-programmer like me, you have no idea how to build the code to add functionality. Fortunately there are some other great tutorials, like this one from http://www.kirupa.com/developer/mx/slider.htm

    The relevant code is:


    this.ratio=0 ;
    dragger.onPress=function(){
    this.startDrag(true,0,0,line._width,0);
    this.onEnterFrame=function(){
    ratio=Math.round(this._x) ;
    }
    }
    dragger.onRelease=dragger.onReleaseOutside=stopDrag;
    or this:


    this.ratio=0 ;
    dragger.onPress=function(){
    this.startDrag(true,0,0,line._width,0);
    this.onEnterFrame=function(){
    ratio=Math.round(this._x*100/line._width) ;
    }
    }
    dragger.onRelease=dragger.onReleaseOutside=stopDrag;

    Now we can use the slider to output ratios from 1 to 100, great for percents!

    GET URL


    One thing we want to be able to do in the program is to make us of the California Solar Initiative Incentive Calculator found at http://www.csi-epbb.com/.  So we need to create a button in flash that calls that website.

    The simple action to attach to the button is


    on(release){getURL("http://www.csi-epbb.com/");
    }


    (You can find functions like "getURL"  by clicking on the + sign under actions at opening "Global Functions" and then "Browser/Network". Make sure you put them after the on(release) command.)



    The only problem is that though the .swf launches a browser when testing on your desktop, when you upload the .swf to a website and click on the button it launches the url in the same window.  This can be a hassle if you are doing on-line training as we are and you want the user to be able to simultaneously view the flash document AND the website the URL reffered to.

    What to do?

    According to ShawnJC:

    "Something you all might be interested. I've been using similar javascript to open windows for some time now, but recently have found out that the new SP2 upgrade for windows XP will install a pop-up blocker by default that blocks a window opened with javascript from a signal from Flash even though it is a user inituated click. I've been trying different things and found that the only way I can get a window to open with Flash that the XP pop-up blocker won't block is with the basic GETURL ("website","_blank") method. So anyway, might wanna test that out if you plan on using Flash and Javascript to open windows..."

    So now my code reads:  on(release){getURL("http://www.csi-epbb.com/", "_blank");
    }  and it works great!

    But wait, there's more!

    The only dissatisfaction I have with using the "_blank" command is that I often already have too many tabs open on my browser (I use Firefox, and I LOVE the new tab feature, but for keeping people involved in a web-based training program it can be distracting to have to keep clicking on different tabs wondering where on the far right of the screen that particular browser window went!) So I want to be able to open the url in a new window (like a popup).

    The code to do that is found here: http://www.actionscript.org/resources/articles/22/1/Pop-Up-window-within-flash/Page1.html

    The basic idea is that you replace on(release){getURL("http://www.csi-epbb.com/", "_blank");
    }
    with a piece of Java Script that looks like this:

     on (release) {
        getURL ("javascript:openNewWindow('http://www.csi-epbb.com/','thewin','height=600,width=800,toolbar=yes,scrollbars=yes');");
    }

    Note that instead of using double quotes in the javascript you use single quote marks.  You can decide if you want the user to have toolbar access (so they can use the window you created to go elsewhere) or scrollbars.  I set them to yes because I like giving people freedom. Vive la liberte!  You can also set the height and width. I like my pop-ups fairly large but not overwhelming.

    All fine and good; it works with the .swf file.  What about opening applications, like Google Earth?

    Opening Applications

    Here I encountered a lot of problems. Seems that somebody created a flash virus once upon a time and so, to protect users from these, the way flash handles functions that call .exe files has been changed.
    But an explanation of how to run files is found here:
    http://www.northcode.com/blog.php/2007/08/07/Conquering-FSCommand-EXEC-Part-1-Proxy

    What I learned to do is to create a folder called "fscommand" in the folder that contains my .fla source file and my .swf.

    Inside that folder I used notepad to create a text document that held this text:

    "C:\Program Files\Google\Google Earth\googleearth.exe" (because that is where Google Earth is on my computer)

    I saved the file and then changed the extension from .txt to .bat.  I called the file "openGoogleEarth.bat".  When I click on it I notice it launches a DOS command window and then launches the program. All fine and good.
    Then, in flash, in my action script for the button I put the following:

    on(release)  {
        fscommand("exec", "openGoogleEarth.bat");
    }

    I notice when I test the movie it does nothing.  But if I PUBLISH the movie as a Windows Projector (an  .EXE file)  as well as an .swf (you find these options under File/Publish Settings) the windows projector will let me launch Google Earth with that button.  The .swf file, however, does nothing.

    I also downloaded a nice little app called proxy.exe that hides the black DOS box.  The trick there was to place "proxy.exe" in the fscommand folder and then rename it "openGoogleEarth.exe" (or whatever name your bat file has.Then IT calls the .bat file which then calls the program.  (You can get better instructions here: http://www.northcode.com/blog.php/2007/08/07/Conquering-FSCommand-EXEC-Part-1-Proxy)


    Thanks to a Swedish forum user named j0h@nB we get the following advice:


    1. A.swf has to be an exe-file, that is, export it as a Flash projector (A.exe)
    2. B.exe has to reside in subfolder fscommand. So, if A.exe is saved in folder C:\somefolder\, then B.exe has to be saved in C:\somefolder\fscommand
    3. You should then be able to use fscommand to execute B.exe as follows...





    Code:
    on(release){
          fscommand("exec","B.exe");
    }

     What about opening files on Macs as well as PCs?

    I turned to this website, http://www.northcode.com/ , for the following advice for how to prepare for cross platform functionality:


    Northcode says the following:


    "If you want to be a little smarter about it you can replace the fscommand exec calls with something like my SmartExec function below.

    SmartExec will figure out what platform it's running on and launch the correct helper to open the target file. The trick is to give your helper applications names that are similar to the file you're trying to open.

    thefile.pdf - name of the file you want to open
    thefile.exe - EXE helper app that opens thefile.pdf on Windows
    thefile_script - AppleScript the opens thefile.pdf on the Mac

    Now to open thefile.pdf you just put SmartExec("thefile"); in your button release events and SmartExec figures out which application to run based on the platform and the helper application does all the work.





    Code:
    function SmartExec(target)
    {
       platform = substring(getVersion(), 1,3);
     
       if (platform == "WIN") 
       {
          // we're running on Windows, target an EXE file
          fscommand("exec", target + ".exe");
       } 
       else 
       {
          // we're running on a MAC, target an AppleScript file
          fscommand("exec", target + "_script");
       }
    }
    There's an article on my blog "Conquering FSCommand EXEC Part 1 : Proxy" that describes how to use a free tool I created and BAT files to open files on a Windows system. If you're using Flash CS3 then you'll also want to have a look at this article FSCommand EXEC is Broken in Flash CS3.

    On the Mac, you would use a compiled AppleScript instead of the BAT file and EXE combination. Like the Windows solution you'll need an AppleScript for each file that you want to open. You can use this script as a tempate.




    Code:
    --set the name of the file to open 
    
    property fileName : "thefile.pdf"
    
    --get the path to the containing folder 
    
    set myPath to (path to me as string)
    set AppleScript's text item delimiters to ":"
    set the parentFolder to ¬
       ((text items 1 thru -2 of myPath) & "") as string
    set AppleScript's text item delimiters to ""
    
    -- find the file and open it 
    
    try
       set targetFile to alias (the parentFolder & fileName)
    on error
       --ie if there's no  file here by this name, it will quit. 
       return quit
    end try
    
    tell application "Finder"
       open file targetFile
    end tell

    I cut and paste Northcode's  SmartExec function into my actions layer and tested it on the PC and it seems to work great. Thanks Northcode!


  • Using Flash MX 2004 to create educational materials

    Frank DiMassa Utility Consulting has hired me again to work out in California creating educational materials to help us realize the dream of the "million solar roofs" initiative and to aid in water and energy conservation efforts.
    Because the materials we are creating are destined for web training, but budgets are tight, we are working with Flash MX 2004 (a.k.a. "Flash 6") and Dreamweaver (though we create our videos in Final Cut Pro).

    As Flash has a steep learning curve (particularly when you are a non-programmer and are working with Action Script) I have decided to post my notes here in this blog post instead of on my physical pad-o-paper notepad (remember pencils and pens and paper?). This way others can benefit from our climb up the learning curve and we can access our notes wherever we happen to be in the world without having to carry a suitcase full of paper!

    Step 1: Converting .mov files to .flv files.

    Since we begin our process by creating our video segments in FC Pro on a Mac, but do our Flash creation on a Windows XP machine, we should start this lesson by exporting from Final Cut to a Quicktime Movie (.mov). Those files are big -- a 3 minute video takes up nearly 600 MB. We pop that onto a USB stick and carry it over to the PC and copy it into our Flash Video folder. Now we have to turn it into a Sorenson compressed .flv file for use in our web presentation.


    A hunt through the user forums revealed this from editorX:
    "hi, it´s possible to create .flv in MX2004.
    import the chosen movie (embedded) in the flash library. select the movie in the library and then right-click on it. select properties and then export in the appearing dialogue."

    Once you do that, you will notice that while the .mov file is now in your library, the .flv file you just created isn't. Don't panic. It should be in the same folder as the .mov file on your hard drive, but it must be now imported into your project library.

    How do you use a video in flash?
    "Basically, it's like a Graphic symbol because the timeline where the video resides needs enough frames to accommodate the entire duration." says UltraShock Tutorials (a great site to go to to learn all about working with video in flash).

    They also say,
    "Remember that because Flash compresses the audio at publish time, it's best to only import .flvs with little or no audio compression and adjust Flash's audio compression settings through the publish settings. (to avoid generation loss due to recompression)."

    If you don't have Flash MX Pro, there are other ways -- free ways -- to convert .mov files to .flv files:

    You can download a free media converter, called Quick Media Converter, here:

    http://quick-media-converter.en.softonic.com/download#pathbar


    Inserting an entire column of frames (shifting all frames in all layers to the right):

    If you want to add frames and extend the timeline for all existing layers accordingly, you merely select the column of frames of all layers at the chosen point in the timeline and F5 them

    How to Delete Frames

    (from http://multimedia.journalism.berkeley.edu/tutorials/webdesign/flash/frames/)

    "Note: Flash has two ways to delete frames - Clear Keyframe and Remove Frames. They're a little confusing. The way to figure out which one to use is to ask yourself why you want to eliminate a frame.
    If you want to eliminate a frame because you want to reduce the length of the movie, then select a frame, and choose Edit > Timeline > Remove Frames, or Shift-F5.
    If you want to remove the status of a keyframe (and therefore, its content), and keep the movie the same length, then select a keyframe or blank keyframe and choose Modify > Timeline > Clear Keyframe (or hold down the mouse and select Clear Keyframe from the menu).
    Clear Keyframe changes a keyframe or a blank keyframe into an in-between keyframe. It removes the content it contained. The new in-between frame displays the content of the previous keyframe."




    Other helpful notes:

    • Motion Tween only works on symbols
    • F8 converts to symbol
    • F6 inserts a new keyframe
    • F5 inserts a frame (and can carry over information from the previous frame)
    • ctl-enter is used to view motion
    • to advance by a frame use the "." key, to go back a frame use the "," key.
    Creation of motion/shape tweens in the basics of flash.

    Before you can specify values in Action Script you need to give each text field an instance name in Property Inspectior

    Componenets -- movie clips that add advanced functionality without you having to know advanced Action Script.

    To labe a Button component: Go to Property Inspector, parameters tab - Label.

    Event handler "Handling Events" in Action Scripts
    Reference Guide Help

    A Button Component has its own timeline. In Timeline hierarchy, component time line is the child of the main timeline. Point to the parent: _parent.

    Set audio to 192 kbps

    Embedding video: a video over 16000 frames will not sync properly and audio quality suffers. But it is more interactive.

    Expand the timeline so all frames are displayed!

    "You'll have to provide your own controller for an embedded movie; flash components (and their skins) won't work".

    Upload of main swf to server -- unlike uploading streaming video, main swf is the only file to worry about.

    Need Flash's video encoder.

    Recommended against using scenes; use framelabels instead.

    on(release) {
    gotoAndStop("scene2", 1);
    }

    is not ideal. Don't use scene names, just the UNIQUE frame labels and add _root to your path.

    Like this:

    on(release) {
    _root.gotoAndPlay("frame-label");
    }

    test the scene using (ctl-alt-enter).

    DON'T USE SCENES!

    "Scenes are an evil kludge created to destroy the minds for otherwise sane flash developers and newbies alike. They are just a way of hiding frame numbers to try and make flash movies more human readable that fails utterly." wrote one flash user on a forum. I agree.

    Helpful action scripts for beginners:

    The following little scripts are your friend for buttons that go back a frame or advance a frame:

    on(release) {
    prevFrame( );
    }

    on(release) {
    nextFrame( );
    }


    My preferred method, if you are going to use the same buttons over and over on every frame, is to attach this action script NOT to the button, but place it in a layer you call "Action Script". If you name the instance of the buttons you can use this function:

    this.forward_btn.onRelease = function( ) {
    nextFrame( );
    }

    and

    this.back_btn.onRelease = function( ) {
    prevFrame( );
    }

    on(release) {
    if(_currentframe = = 1) {
    gotoAndStop(10);
    } else {
    prevFrame ( ) ;
    }

    The conceptual basics:
    1. Graphics objects
    2. Button objects - normal, mouse-over, click, target
    3. Movie Clip
    In the button timeline, target is the area of the button you want mouse events to react to (the center of the button for example, but you could make the target another area of the screen if you wanted).
    Movie Clip is similar to Graphics object on the surface but can be used to create entire animations that can be dragged onto the main movie. Animations created as graphics objects simply loop over and over, but you can control movie objects completely.

    How I finally got the Media Clip to play:

    To get my .flv to play and be interactive, so that I could pause it for the instructional moment and then continue, I first created a mediaclip to embed in one of the frames of my presentation. Then I double clicked on that clip to open its own timeline and created a buttons layer in that timeline and a video layer. I dragged the .flv into the video layer and then created enough frames in the buttons layer to cover all the frames that were in my video layer. Then I created my start and stop buttons and my frame advance and previous frame buttons in that layer. I called them play_btn, stop_btn, prevframe_btn and nextframe_btn.


    Rather than attach an action script to the buttons themselves, I created an actionscript layer in the mediaclip timeline, again with enough frames to cover the whole .flv. Then I only had to type in the following code once:


    this.play_btn.onRelease = function() {
    play();
    }

    this.stop_btn.onRelease = function() {
    stop();
    }


    this.prevframe_btn.onRelease = function() {
    _root.gotoAndPlay(1);
    }

    this.nextframe_btn.onRelease = function() {
    _root.gotoAndPlay(4);
    }


    Note that "_root" is necessary in order to have the button take us out of the media clip timeline and back into the scene's timeline.


    Using the Component Inspector

    It took me a while to find the component inspector after I added the Media Component. Now I know where it is: Look in the Properties window after selecting the media component. There should be a button that says "Launch Component Inspector" under text saying "This component's parameters must be edited using the Component Inspector". You should then see two tabs on the right: Properties and Parameters. Click on Parameters.

    Montag, 11. August 2008

    5 is a beautiful number

    5 is a beautiful number
    lyrics by T.H. Culhane
    for David Korn on account of he likes this tune!





    (Sorry, this is just a draft; there are no visuals yet, and lots of mistakes!)

    Sung to the tune of "Oh What a Beautiful Feeling"

    5 is a beautiful number
    Think when you multiply 5: All ends in 5 or in Zero...
    That's how you know that its right!

    Zero times 5 gives you zero,
    One times five's naturally five,
    5 times 2's 10 -- 1 and Ze-ro!
    3 fives 15 -- 1 and 5

    4 rows of 5 gives you Twenty (2-0)
    5 times itself's Twenty-Five (2-5)
    6 groups of 5 gives you 30 (3-0)
    7 times 5's 35! (3-5)

    8 groups of 5 gives you 40 (4-0)
    9 groups of 5: 45 (4-5)
    10 groups of 5 gives you Fifty (5-0)
    Just Alternate Zeros and Fives!

    Even ones end with a Zero (2,4,6,8,10)
    Odd numbers end with a Five (1,3,5,7,9)
    Learn them and you'll be a hero,
    when you can multiply five

    Five's products add up in series (0, 5, 1, 6, 2...)
    There's always 5 in between (7, 3, 8, 4, 9...)
    The first series starts out with zero
    The odd one off course starts with 5...

    Let me explain somewhat clearer:
    Think of 10 -- zero plus 1
    you...
    then see 15 's 5 plus one: SIX!
    20's "2-0" makes 2

    "25" adds up to 7
    "30" would add up to 3
    "35" adds up to 8 and
    40 is four, you can see

    5 is a beautiful number
    There's so much to be done with five
    5 is a magical number
    Listen, I'll try to describe:

    5 x 11's just fifty (5x10) PLUS five times one's 55
    5 x 12's easily 60: 5 x 10 plus 5 x 2

    5 x 13's al-so easy: 5 x 10 plus 5 x 3
    5 x 14 -- just add 20
    Now you try 5 x 15!________

    5 x 16 start with 50 (5x10)
    plus thirty from 5 groups of 6
    Add them together, that 80!
    Now you are learning some tricks!

    17 5's: start with 50
    + (7x5)'s 35
    This way you use your addition
    to help you when you multiply!

    5 x 18: you take 50,
    then multiply 5 x 8
    50 + 40 make 90;
    Some day you won't hesitate!

    5 x 19, you add 50
    to 5 x 9: that's 45
    95 ends up the answer
    Odd numbers end always in five

    Fi-na-lly we have 5 20's
    5 Twenty green dollar bills
    5 x 2's 10, plus a zero
    That makes one hundred - now drill!

    Cause 5 is a beautiful number
    Think when you multiply 5 All ends in 5 or in Ze-ro
    That's how you know that its right!!

    Sonntag, 10. August 2008

    Math in the summertime...

    This simple Melodic-Mnemonic is for the Korn family to sing on a summertime road trip to pass the time and help the boys enjoy learning the times tables. Enjoy!

    (The original Mungo Jerry song with Karaoke lyrics is below:)






    Math in the summertime...
    lyrics by T.H. Culhane


    Sung to the tune of "In the Summertime" by Mungo Jerry:

    In my 4 x 4, driving down route SIXTEEN
    was a 2 x 4 and an 8 track machine,
    singing 5 x 4 is 20, 3 x 4's a dozen
    eggs are on my mind!
    "Timesing" 6 x 4, gives you twenty-four,  2 dozen eggs to fry!

    When it's 8 x 4 then you have 32
    But we still have more multiplying to do
    9 x 4 is 36, yeah, and with 4 by 7 you get 28.
    That leaves 10 x 4 --  equals  40 acres and a mule... but wait!

    (there's more... mul-ti-plica-tion!)

    4 x 12: that one makes 48
    And 11 fours?   44 it creates
    and then 13 groups of 4 is 52
    but 1 times 4 is simply 4
    When you  multiply by the number 1 it doesn't get you more.

    Finally 4:15 -- that makes 60, not more
    When I'm 64 then its 16 by 4
    And 4 17's is 68 and 18 4's  creates 72
    End with 20 4's you get 80;  I'll leave 19 4's for you...

    (76 Trombones in the big parade!)

    Here's a QND (Quick  'N Dirty) mp4 of the song to sing along with, with Karaoke style melodic-mnemonic lyrics:  See if you can edit your own visuals to it that help you learn the 4 times tables! The learning comes through repetition and interaction!

    Montag, 4. August 2008

    As We Sow, So Shall We Reap



    I wrote this song in 2000 while travelling by bus from Mexico to Panama, travelling with Angel Orozco and Jill Sourial as part of our Mundo Iximche Maya Breadnut mission.  Most of it 'God downloaded to me' (as my gospel mentor Iris Stevenson from Crenshaw High School  used to say!) in a home stay in El Salvador.  I recorded it in the summer of 2001 in Damascus, Syria, with Syrian television and recording star Rasha Rizk singing and her husband playing lead guitar; Rasha and I multitracked the gospel choir parts and I played acoustic guitar (a baby Taylor that could fit in the overhead rack of the airplane). Rasha played bass and keyboards and syn drums. As an Arab-American Christian it was delightful to perform this with Rasha and her husband, who are Druze and Muslim, as it became the perfect interfaith dialog song.  When the Sept. 11 tragedy happened shortly thereafter we knew the song was needed in order to bring Christians and Muslims and Jews and people of other faiths back together.  The song was broadcast at the Bosra festival in Southern Syria in the ancient Roman Ampitheater after our Circus Guy Musical Goodwill concert to an international audience and we hope that it will be used to help create a new healing dialouge now that the horrors of the Bush years are over!

    Lyrics and Chords found below:

    Lyrics:

    As We Sow, So Shall We Reap
    (a.k.a. "More and More: the thanksgiving song")

     copyright 2000 T.H. Culhane
    sung by Rasha Rizk and T.H. Culhane
    recorded in Damascus, Syria, summer 2001


    Life seems full of problems
    Never time enough
    Work yourself to death just to accumulate more stuff

    No time for true Thanksgiving
    No room for Christmas Cheer
    Seems we've lost our meaning and forgotten why we're here

    But Lord I'm not a taker
    And Lord my needs are small

    I want to make this holiday be holy after all

    For as we sow, so shall we reap
    The more we give
    The more we really keep
    And when we learn to give it all away
    We find there's more...
    and more...
    and more...

    Hallelujah...
    Hallelujah...
    Allah...
    Allah...
    Hallelujah...  Hallelujah...


    Considering the lilies
    considering the birds
    In Nature lies the evidence concealed within His words


    He gives with such abundance
    That we should do the same
    And if our lives are short and mean...
    we have ourselves to blame...

    For as we sow, so shall we reap
    The more we give
    The more we really really keep
    And when we learn to give it all away
    We find there's more...
    so much more...
    than we thought...

    There's always more and more and more and more...

    (Gospel choir):

    "Because it's world without end
    'til God comes again
    As it was in the beginning, as it is and ever shall be
    We should be good to Men
    Make all Men our friends
    For blessed are the pure in heart...
    we've got to make a start...

    Blessed the meek,
    The makers of peace...
    The world is not so bad a place as some would try to make it...
    It's a world without end...
    'til God comes again...

    Amen"

    Allah.....

    For as we sow... so shall we reap...
    There's always...

    more.

    More and More c 2000 T.H. Culhane
    Lyrics with Chords:

    (Gmaj7) (Gdim) (F#m) (Bm)
    Hmmm mmm hmmmm mmm hmmmm
    (Em7)   (A7)     (D6/9)
    Hmmm mmm hmmmm mmm hmmmm

    (VERSE)
    (Gmaj7)
    Life seems full of problems
    (Gdim)
    Never time enough
    (F#m)                                            (Bm)
    Work yourself to death just to accumulate more stuff
    (Gmaj7)
    No time for true Thanksgiving
    (Gdim)
    No room for Christmas Cheer
    (F#m)                                                (Bm)
    Seems we've lost our meaning and forgotten why we're here
         (Gmaj7)
    But Lord I'm not a taker
          (Gm)
    And Lord my needs are small
    (F#m)                                     (B7)
    I want to make this holiday be Holy after all

    CHORUS:
                      (Gmaj7)             (Gdim)
    For as we sow, so shall we reap
                        (F#m)
    The more we give
                           (Bm)
    The more we really keep
                         (Em7)              (A7)
    And when we learn to give it all away
                            (Bbmaj7)
    We find there's more...
            (Gm7)
    and more...
             (D6/9)
    and more...

    GUITAR SOLO
    (Gmaj7) (Gdim)
    Hallelujah...
    (F#m) (Bm)
    Hallelujah...
    (Gmaj7)  (Gdim)
    Allah...
    (F#m) (Bm)
    Allah...
    (Em7) (A7)  (D6/9)
    Hallelujah...  Hallelujah...

    VERSE
    (Gmaj7)
    Considering the lilies
    (Gdim)
    considering the birds
    (F#m)                                   (Bm)
    In Nature lies the evidence concealed within His words

    (Gmaj7)
    He gives with such abundance
    (Gm)
    That we should do the same
    (F#m7)
    And if our lives are short and mean...
    (B7)
    we have ourselves to blame...

    CHORUS:
                      (Gmaj7)             (Gdim)
    For as we sow, so shall we reap
                        (F#m)
    The more we give
                           (Bm)
    The more we really keep
                         (Em7)              (A7)
    And when we learn to give it all away
                            (Bbmaj7)
    We find there's more...
            (Gm7)
    and more...
             (D6/9)
    and more...
                          (Bbmaj7)          (Gm)                (D6/9)
    There's always more, so much more, than we thought
                                            (Bbmaj7)   (Gm)        (D6/9)         
    There's always something more, ever more, ever more

    (GOSPEL CHOIR):
                            (Bbmaj7)
    "Because it's  World Without End
          (Gm)
    'til God comes again
           (D6/9)
    As it was in the beginning, as it is and ever shall be
                   (Bbmaj7)
    We should be good to Men
                 (Gm)
    Make all Men our friends
          (D6/9)
    For blessed are the pure in heart... we've got to make a start...
     (Bbmaj7)
    Blessed the meek,
    (Gm)
    The makers of peace...
    (D6/9)
    The world is not so bad a place as some would try to make it...
    (Bbmaj7)
    It's a world without end...
    (Gm)
    'til God comes again...

    (D6/9)

    Amen"
    (Bbmaj7) (Gm) (D6/9)
    Allah.....
                   (Gmaj7)
    For as we sow...
                       (Gdim - slide up neck of guitar)
    so shall we reap...

    There's always...
    (D6/9)
    more.