Category: ActionScript Page 3 of 4

Infinite Canvas

Taco ride last week was awesome perfect weather for a twenty mile bike ride.  I had a blast but its not hard to when you have the perfect…

myUniveRSS goes too Facebook

I have been very busy for at work learning Ruby on Rails.  I have even managed to create a cool facebook application using Ruby on Rails and AS3/Papervision3D…

Alchemy Its No Myth

The future of web applications lies in the hands of rich internet application developers. The two main platforms of the future will be Adobe Flash/Flex/Air and Silverlight. This…

PaperVision3D RSS Reader Alpha

Well I have been working on an RSS feed reader that is papervision3d based it is still nowhere near where I would like it to be. I have…

Using ScaleNine Skins in Flash Develop3

Have you ever wanted to use a Scale Nine Skin in your Flash Develop environment? Well its easy. Here is an example you can download. Here are few…

Generative Art With Kuler

Computer Art starts with Computer Arts magazine.  I highly recommend a steady dose of Computer Arts magazine and Friends of Ed publications to any aspiring developer / designer. …

Memorial Park Cubic Panoramic

Well here is my cubic panoramic picture of Memorial Park.  I actually took this picture several years ago.  This is an extremely simple almost out of the box…

Worked Through a Couple of Tutorials

Well I have been reading and studying Ruby on Rails this is not my first time using Ruby on Rails I have actually completed some tutorials I originally…

Unity3d and Other Rants

Unity3d just came out with support for the Wii! Unity is also going to be working on the iPhone soon. Thats cool so what is Unity? Unity is…

Yahoo Pipes + AS3 = Some Issues

Well I have been working with ActionScript3 and come across a few gotchas. Here is my conundrum. Yes it is the infamous TypeError: Error #1085: This error occurs…

C/C++ to ActionScript

What if Microsoft is not the only company with a multiple programming language translation tool built into their rich internet application platform? Wouldn’t it be nice to simply…

Augmenting Human Intellect

In short I think Douglas Engelbart would be pretty proud of his legacy. He was an academic that probably had the one of the most profound contributions to mankind. His ideas were snicked at in the beginning at SAIL. Most people believed the future of computing at that time wouldbe in the field of AI of course AI has proved to be a little difficult. In the beginning pretty much all of the code was open source. Douglas Engelbart’s group was responsible for the creation of the first mouse and graphical user interface. Many of the people he taught and worked with eventually worked at Xerox (Like Alan Kay). Xerox created a personal computer before anyone else was able to but their board executives didn’t understand at the time the overall impact of what they were looking at so they gave it all away to Steve Jobs and the rest is of course history.

In the beginning most of the technology was open source. Most of the computing technology we use today was at one point open source. One of the biggest problems today in development is picking a platform. Because of proprietary formats etc.. you can’t develop for just one platform you have to develop for multiple platforms depending on the technology you want to utilize. It is always good to see new technologies open their formats. Adobe Systems recently opened up their SWF (ShockWave Format) under their Open Screen Project! This is wonderful for developers because developers have the power now to do just about anything they want with it now! I believe you will see flash in lots of places you never thought you would see flash. Adobe recently came out with AIR (adobe integrated runtime) Air can run on any machine! I recently upgraded my Ubuntu to the Hardy Heron (which went real smoothly) and Air runs quickly on it! You can even build Air applications quickly on open source IDE like eclipse or aptana. One benefit of Adobe opening their platform is the fact developers will modify it to run on machines that wouldn’t normally run Flash. I believe in the next few years there will be money to be made in small customizable Linux devices. Moore’s Law has not let us down yet. The tech sector is still strong even in the face of recession probably has something to do with Moore’s Law and I really don’t think the internet is going to go away anytime soon the inventor of the Internet (not AlGore) did inform us it was still in its infancy. For those of us in the tech sector we know (not think) things will only improve and the web is the platform. Check out Air it is realtively easy to build an application and it will work on any machine. I have also been studying up on Silverlight. I recently ordered a few books on silverlight from Amazon.com. One of the nice things the microsoft has done with their RIA(Rich Internet Application) project silverlight is support open source projects like moonlight.

Aptana on Air!

Douglas Engelbart Mother of All Demos:

Side note: I have been pondering switching this blog to utilize wordpress I have used drupal for years but wordpress supports more plugins and is less of a pain to configure. I do have a copy of this blog running locally on drupal six but it lacks support for other programs I have integrated into the current i-create. So in short I may be changing this soon to wordpress. I will also be supporting ads on this blog soon.

FlashDevelop Quick Start

What is Flashdevelop and why should I care? FlashDevelop is an opensource integrated development environment (IDE). It was created using C# on the .net 2.0 so it runs on any windows box that has .net 2.0 or higher and Java 1.6 runtime. .Net 2.0 and Java 1.6 are already on most windows computers. The user also needs to have the Flex SDK to install FlashDevelop IDE properly. You can use this IDE to write action script 2/3, flex MXML, and HAXE. You can actually pick from several compilers. It is a wonderful open source program and if in the right hands can be utilized to write ActionScript quickly.

The people of Adobe have all been working hard on improving the features of ActionScript and they have a lots of open source libraries that allow developers to rapidly create highly functioning and quick rich internet applications (RIA). This example is only a beginner example note this is just suposed to be informative and quick. In regards to use the FlashDevelop IDE and it is based off of Mike Chambers example.

Step 1: Install the FlashDevelop IDE from their site here. Also make sure you follow the requirements found here.

Step 2: install the Flex SDK here.

Step 3: Insert the Flex SDK location here by selecting Tools from the drop down then go to Program Settings navigate to the AS3 Context panel and insert your Flex SDK location as shown below (click to enlarge):

Step 4: Create a new ActionScript 3 Flex 3 project name it and then hit OK as shown below:

Step 5: Minimize your FlashDevelop IDE. For this you will also have to download and install 2 ActionScript libraries written by the Adobe Developers and located on Google Code here: CoreLib , XMLsyndication Lib. Download the code extract and place the code on your computer. You will need the path so do not place it in a temporary location place it ether in its actual program directory or a place of your own choice. Once you have done that open FlashDevelop again. To your new Flex 3 project. Navigate to tools and drop down to Global Class paths. Place the paths to the code you just download and installed in the dialog window as shown below:

Step 6: Navigate to the SWC files right click on them and select add to library as shown below:

Step 7: Once you have done that you need to create your RSSExample.mxml document. To do this right click on your project drop down to add, select the new .MXML file name it RSSExample.mxml. Then right click on the project again add new ActionScript class name it RSSExampleClass.as.

Step 8: Now Place this code into the RSSExample.mxml file:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

<mx:Script source="RSSExampleClass.as" />

<mx:TextArea left="20" top="10" bottom="40" right="10" id="outputField"/>
<mx:Button label="Load RSS" right="10" bottom="10" click="onLoadPress()"/>

</mx:Application>

Step 9: Now Place this code into the RSSExampleClass.as file:

import com.adobe.utils.XMLUtil;
import com.adobe.xml.syndication.rss.Item20;
import com.adobe.xml.syndication.rss.RSS20;

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

private var loader:URLLoader;

//url of rss 2.0 feed
private static const RSS_URL:String = "http://i-create.org/node/feed";

//called when user presses the button to load feed
private function onLoadPress():void
{
loader = new URLLoader();

//request pointing to feed
var request:URLRequest = new URLRequest(RSS_URL);
request.method = URLRequestMethod.GET;

//listen for when the data loads
loader.addEventListener(Event.COMPLETE, onDataLoad);

//listen for error events
loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);

//load the feed data
loader.load(request);
}

//called once the data has loaded from the feed
private function onDataLoad(e:Event):void
{
//get the raw string data from the feed
var rawRSS:String = URLLoader(e.target).data;

//parse it as RSS
parseRSS(rawRSS);

}

//parses RSS 2.0 feed and prints out the feed titles into
//the text area
private function parseRSS(data:String):void
{

//XMLSyndicationLibrary does not validate that the data contains valid
//XML, so you need to validate that the data is valid XML.
//We use the XMLUtil.isValidXML API from the corelib library.
if(!XMLUtil.isValidXML(data))
{
writeOutput("Feed does not contain valid XML.");
return;
}

//create RSS20 instance
var rss:RSS20 = new RSS20();

//parse the raw rss data
rss.parse(data);

//get all of the items within the feed
var items:Array = rss.items;

//loop through each item in the feed
for each(var item:Item20 in items)
{
//print out the title of each item
writeOutput(item.title);
}
}

private function writeOutput(data:String):void
{
outputField.text += data + "\n";
}

private function onIOError(e:IOErrorEvent):void
{
writeOutput("IOError : " + e.text);
}

private function onSecurityError(e:SecurityErrorEvent):void
{
writeOutput("SecurityError : " + e.text);
}

Step 10: Now run a test as show below:

Step 11: If successful should look like below:

Wow now that was cool. Now think about what you can do with that tool their lots of open source libraries to play with so get started. One thing I would like to do is play with the source and see if it could be ported to the Mono platform and make it run on Linux or Windows. Any way hope you had fun.

ActionScript3 SharedObject / FlashVars

Custom C# Control:

Note this is only part of the control. With a little more work you can easily make is so you can drop it on a page and simply name the FlashAudioVariable to point to the name of the flv.

Panel pnlAudioContainer = new Panel();
pnlAudioContainer.ID = string.Concat(this.ID, "_pnlAudioContainer");
pnlAudioContainer.Style.Add("float", "left");
pnlAudioContainer.Style.Add(HtmlTextWriterStyle.Width, "100%");
pnlAudioContainer.Style.Add(HtmlTextWriterStyle.Height, "2px");
Panel pnlAudio = new Panel();
pnlAudio.ID = string.Concat(this.ID, "_pnlAudio");
pnlAudio.Style.Add("display", "inline");
pnlAudio.Style.Add("float", "right");
pnlAudio.Style.Add("_margin-top", "-23px");
pnlAudio.Style.Add(HtmlTextWriterStyle.Width, "90px");
pnlAudio.Style.Add(HtmlTextWriterStyle.Height, "30px");

string Flashobjectstart = "<noscript><object classid=’clsid:d27cdb6e-ae6d-11cf-96b8-444553540000′ codebase=’http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0’width=’90’ height=’30’ align=’middle’><param name=’movie’ value=’yourlocatointo.swf’ /><param name=’quality’ value=’high’ /><param name=’bgcolor’ value=’#FFFFFF’ /><param name=’FlashVars’ value=’myVid=rtmp://video/audio/location/";
string Flashobjectmid = "’ /><embed src=’yourlocatointo.swf’ flashvars=’myVid=rtmp://video/audio/location/";
string Flashobjectend = "’ quality=’high’ bgcolor=’#FFFFFF’ width=’90’ height=’30’ align=’middle’ type=’application/x-shockwave-flash’pluginspage=’http://www.macromedia.com/go/getflashplayer’ /></object></noscript>";
string FlashJS1 = "<script language=’javascript’ type=’text/javascript’>FlashAudio(‘";
string FlashJS2 = "’);</script>";
string FlashAudio = string.Concat(Flashobjectstart, audioFileName, Flashobjectmid, audioFileName, Flashobjectend);
string FlashAudio2 = string.Concat(FlashJS1, audioFileName, FlashJS2);
pnlAudio.Controls.Add(new LiteralControl(FlashAudio));
pnlAudio.Controls.Add(new LiteralControl(FlashAudio2));
pnlCaptionMain.Controls.Add(pnlAudioContainer);
pnlCaptionMain.Controls.Add(pnlAudio);

Shared Object in ActionScript3 w/ FlashVars:
There are slight differences in the way the flash player 9 handles flashvars. This is a working example of how a custom flv player would use flash vars to call a video or audio file and play it! It also uses a shared object the benefit of this is its persistence (like a cookie on stereiods) if you had say several videos that you wanted to play on several different pages but you wanted the player to stop / rewind and if your user tells it to stop to remember the user told the flash player to stop here is how you would do that:

ActionScript3 SharedObject External Video / Audio in Flashvars:
import fl.video.*;
var flvControl = display;
var flashvars:Object = LoaderInfo(this.root.loaderInfo).parameters;
var flvSource = flashvars[‘myVid’];
flvControl.autoRewind = true;
var my_so:SharedObject = SharedObject.getLocal("userPref");
if (my_so.data.stopped == undefined) {
flvControl.play();
flvControl.autoPlay = true;
toggle_btn.gotoAndPlay(1);
} else {
flvControl.stop();
flvControl.autoPlay = false;
toggle_btn.gotoAndPlay(2);
}
function completeHandler(event:VideoEvent):void
{
flvControl.seek(0);
flvControl.play()
}
flvControl.addEventListener(VideoEvent.COMPLETE, completeHandler);
flvControl.source = flvSource;
function toggleHandler(event:MouseEvent):void
{
if( flvControl.playing ){
my_so.data.stopped = 1;
my_so.flush();
flvControl.stop();
toggle_btn.gotoAndPlay(1);
}else{
if(my_so.data.stopped == !undefined)
{
my_so.clear();
}
flvControl.play();
toggle_btn.gotoAndPlay(2)
}
}
toggle_btn.addEventListener(MouseEvent.CLICK, toggleHandler);

Flash For Drupal and WordPress

Anyone who has designed in flash knows first hand what a pleasure it is and how nice the results can be. Flash has come a long way since future splash and it shows. A number of people in the open source community have been developing flash skins for everyones favorite content management systems namely Drupal and WordPress! Drupal recently added Services module with version 5 makes configuration a breeze!

You can find an excellent article by Justin Girard here on how to integrate drupal with Flex using amfphp!

For those of you in the wordpress camp you can also enjoy a flash front-end!

Drupal and Wordpress developers have also been working on an extension that integrates the administration featuers directly into firefox with

http://groups.drupal.org/node/1331

http://www.schloebe.de/firefox-extensions/wordpress-helper/#english

ScribeFox

Through the use of amf-php it would also be a good idea to develop an Apollo authoring application.

 

Side Note on M$ Silver Pile of Poo:

Lets make it simple it is not cross platform otherwise it would support Linux. You don’t even get all the advatages of using it if you are an Apple user. It is simply too little too late for microsoft. I personally wish they would stick with their operating system and not bother with creative applications that should be left to the professionals at Adobe. Maybe with their free time they could make ie7 better..

11Years of Flash – Long Live Flash!

Other Cool Sites:

PaperVision3d
OSFlash
RIAForge

State of Open Source

Well recently you might have noticed Adobe rather large contribution to the Mozilla foundation! Adobe handed over all the code to create an open source flash virtual machine. This is a big deal because this will ensure flash runs on more operating systems with out a catch. Adobe now has flash player 9 available for the Linux community. It will be pleasing to see the flash open source community to grow.

 

It is also common knowledge that Java has been in the process to moving toward becoming open source and now that dream is a reality for developers. Java still does have a great deal of potential. Now that it is completely open source it will be interesting to watch it grow.

 

Some of you might be surprised to learn of Microsoft’s new deal with Novell. Although Novell has been catching a great deal of flack I do agree that some integration between the systems would be nice. It also seems to signal Microsoft’s realization that the Linux will always be a competitor in the server market. I believe it is too tough to say right now if this move by Novell was a good move or a bad move only time will tell. Microsoft has also recently moved to support projects like Zend so it is nice to see Microsoft being more open to open source.

 

The drupal content management system is also on the verge of its fifth release!

 

It is certianly an exciting time for open source and I think open source will benefit from Microsoft’s upcoming release of Vista. I really don’t see Vista being utilized the way Microsoft believes it will be and I see this as a key opportunity for Linux to catch up!

FC64

Why because an open source commodore 64 emulator is way cool (after all it was a flashforward finalist this year). Darron Schall and Claus Wahlers.out did themselves with this creation that utilizes the flash 9 player and flex 2! I highly recommend checking it out after all it is open source so at least you can see what makes it tick! Flex 2 has a great deal to offer developers. The over all strategy for Adobe right now is to enable developers to create highly dynamic applications that are for the most part operating system free.

Flash & Flex Source Files

This week site of the week is a tie between IFBIN and MTASC (Motion Twin). The ifBin is an excellent resource for flash developers there is a considerable amount of code to learn from, it also happens to be one of the only areas on the web where you can download source files for Flex projects. If you are a developer I strongly encourage anyone learning Flex or Flash to dig through the ifBin and see what you can find. The ifBin has some pretty neat projects like a FLEX news aggregator that is cool. This site also used to charge a $250 membership fee; now you can receive all the projects for free!! Motion Twin is an action script library open source compiler. This means you can create .swf by simply writing the code and compiling it. This is great if you know exactly what you want to do and can code it. I am also interested to see if anyone tries to create a gui for it and then it would be great but one thing at a time is fine with me! The bottom line is both of these sites are worth your time so check them out. Click Here for ifbin in aciton?

Campus Map

The campus map needs to be re-done.� We have a new map and I have created a map application.� The map application will allow the user to zoom in or out, click on hot spots are designated on the map currently as blue pulsating loops (hot spots fill the picture window with a panoramic picture, or photo, when they click it, this will also change the text).� The user can also move the map.� We will need a list of building, text, and new pictures.� I have some panoramic that will most likely need to change.� We can fill it up right now with photographs and take some panoramic pictures as well.� I also think we need a printable map with all the written content so if some one chooses they can save it, and print it. Steps for completion new photos and panoramic pictures, text, slight design modifications after that the only thing that will be needed is a pop-up window to the project! This is a prime example of the kind of projects I enjoy working on!

College of Saint Mary Map