Tag Archive for 'Flash'

Simple Screen Size Notification in AS3

I have made a small class that you can use if you would like to do something when your flash player is scaled to a maximum or minimum  size. I have seen this used before where if the user scaled the browser to less then 1024×768 the user was warned to scales their browser to the correct size.

I have also added the ability to ignore all out of bound events with a simple method call.

Download Zip here
http://gfxcomplex.com/blog/wp-content/uploads/2008/07/screensizenotification.zip

Source comes with completed example file.

Heres some example useage

import com.gfxcomplex.screen_management.ScreenSizeNotification;

var testing:ScreenSizeNotification = new ScreenSizeNotification();
testing.manageStage(stage, {minSizeW:550, minSizeH:400, maxSizeW:1000, maxSizeH:850});
testing.addEventListener(ScreenSizeNotification.SCREEN_LESS_THEN_MIN, tooSmall);
testing.addEventListener(ScreenSizeNotification.SCREEN_GREATER_THEN_MAX, tooBig);

function tooSmall(e:Event):void{
	trace("Too small");
}

function tooBig(e:Event):void{
	trace("Too Big");
}
//if needed to stop event dispatches use testing.ignoreEvents(true);

Difference of Video played with hardware support vs. non hardware support (”FLVPlayback bug pt2″)

I thought it would be interesting to show you what video is like with and with out hardware support in the flash player. My need to look for the difference came after finding out that video is not always playing at it’s full potential if you use the StageDisplayState class with your FLVPlayback component as I discussed here.

What I found is that the hardware support helps the video by providing some anti aliasing that gives the video a nicer cleaner edge. Below I have examples that show this anti aliasing in action. The examples come from the video I have as a demo in the first part of this topic (”FLVPlayback bug pt1″) found here .

To see the difference in the video playback with and with out hardware support all you have to do is use the full screen button on the player to use hardware support or click on the stage it’s self to use the StageDisplayState class to play the video with out hardware support.

Flash video in full screen With Hardware support
with-hardware.png
flash video in full screen With out.
without-hardware.png

Here are two more examples with high res links
high res With



high res With Out
small-without.png

In the first part of this topic one of the commenting readers named Pietro provided two links to a possible solution to the bug found with the full screen mode and the flv playback component.

But as posted in the article there is a catch 22:

The FLVPlayback component includes the skinScaleMaximum property, which enables you to limit the scaling of the FLVPlayback skin when hardware acceleration is used. You may choose to limit the scaling based on the specific content that is being scaled and your aesthetic tastes regarding the appearance of large skins. Limiting the scaling of the skin, however, requires a combination of hardware and software to scale the video. In some cases, limiting the scaling of the skin can adversely affect performance on videos with large dimensions that are encoded at a high bit rate. If the video is large (640 pixels wide or more, 480 pixels tall or more, for example), you should avoid setting skinScaleMaximum to a small value—because it could cause performance problems on large display monitors

This leaves me to wonder about custom made players and if they support hardware rendering and if so how they achieved it. Such players as JW FLV MEDIA PLAYER 3.15 leave me wondering if they too provide a hardware rending player.

To be continued…

How to relocate for a job?? [pointers for approaching jobs out of state]

After approaching leads in st. Louis and still being out work I have made an effort to look for jobs just out of my area. If there is one thing that is not well documented, it’s relocating for a job. How do people do it? what are things you should consider when your willing to relocate for a job. Should you try to negotiate your costs of moving with your possible job prospects? These are all things I wish to know more about before hopping on a train or plain. Any pointers?

PS: If you don’t know by now I am looking for work and I am a flash developer / designer.
Here is my resume:http://gfxcomplex.com/josh_chernoffs_resume.pdf


How qualified are you for that Flash and or Action Script job?

I have been wondering how my skills compare to other developers / designers out there and if I could call my self a true Flash pro yet. With the wide range of tasks Flash and Action Script can achieve it’s not so black and white to say your the best qualified person for that job title of Flash pro. So I am trying to outline what it takes to archive a title of skill level in flash Design and Development

Lets start with what makes a novice flash developer / designer.

To say your a Novice Flash skill level you should have a good understanding of the following.

  • You know how to use the time line and stage.
  • You know how to make display object instances (MovieClips, Buttons, Images, ect…)
  • You know how to use the time line shape tweener and motions tweener.
  • You know how to Nest objects and have a understanding of scope
  • You know the basics of embedding in html
  • You can identify every tool in the tool panel

Even a novice skill leveled flash worker can produce high quality animations and banners. From my experience people who work in flash as a designer / animator never really perspire to learn more skills then this.
When I think in terms of the wages that level of skill is qualified to make I think in the range of $15 - $30 per hour.

If your have a moderate skill level of Flash then you have a understanding of the following

  • What action script is and the different types there are (AS1, AS2, AS3)
  • You know how to use action script on the time line to interact with display objects, property’s, methods and vars.
  • You have a basic understanding of var and how to use them

For the most part this is your average flash designer / developer. This level of skill is seen in flash sites that have a basic level of interactivity. Most of the time the type of web sites seen from users of this skill level are static a have some time of animation involved in it. When I think in terms of the wages that level of skill is qualified to make I think in the range of $15 - $40 per hour.

To be a advanced developer / designer you must understander the following

  • You know how to write with strict Datatypes, Class, Naming conventions
  • You know how to use and manage data from local and remote data sources (XML, flash var, remoting via AMF, ect..)
  • You have a basic understanding of OOP and design styles of programing such as MVC
  • You have little experience with frame works and have used one in a development project.
  • You have about two years experience with programing with Action script and working in the Flash IDE

This is your average freelance developer / designer and makes any where from $20 - $60 per hour depending on their professional experience and portfolio. The types of projects you see in flash on common web sites are made with the help of an advanced flash developer / designer.

Do you think your a pro yet?

I could use some help with describing this level of skill as I have yet to make it pro, but from what I can tell this is your average Pro flash developer / designer.

A pro Flash Developer / Designer:

  • Can write a complicated framework top to bottom
  • works on a production team of other pro flash developers and or has a consultant or support group of other pro flash developers
  • Can utilize complex APIs and data types such as the byteArray class.
  • has had his or her work showcased as best of it’s type at least once.

You can tell what a flash pro’s work looks like. Have a look at http://thefwa.com Every great site that gets showcased there is made by a professional team of flash developers and designers. Though I better there are many pros not show there too. From what I understand many Flash professionals make on average any where from $60 - $150+ per hour.

I know there maybe a few areas that I have not included here in my list. Feel free to add your opinions and or share your level of skills and why you think you are qualified for your title.

Play hang man with Digg.com ~ [ Digg man ] ~

I made a hang man game that uses digg’s headlines as the thing you need to guess to win. It’s still in Alfa and needs some testing for usability and difficulty. Please try it out and tell me what you think of the game in it’s current state.

http://gfxcomplex.com/labs/digg_man/

Please note that the game play is not complete yet. I want to correct any problems with the usability before I progress any more with the game play.

TODO:

  1. Complete game logic
  2. Add more dynamic content for game play (Levels, ect…)
  3. Add scoring system

(AS3 === AS3) = false! I am frustrated with the Flash vs Flex API’s and the bias of the community

What are the excuses for not allowing all that flex can do in flash or vice versa? I think AS3 should be AS3 not Flash’s AS3 or Flex’s AS3. I believe Adobe needs to address this big problem. We need a discrepancy free program language. The web community has become more bias to Flex over the last year with out concern for the developers working in Flash. Example Yahoo’s map API which works just fine in flash’s AS2 now is limited to flex in AS3 though with out any real under standing why.

From an IDE stand point what is the use of providing a IDE the power of AS3 only to limit it’s use? I want to know why Flex can do more then flash. From what I under stand the hole flex API is built off of the components built in flash. I think this bias for one IDE over the other with in the context of AS3 is setting the stage for failure and leaves a negative precedences in our community. I believe adobe needs to merge the two programs in to a single IDE or make a better attempt to bridge their discrepancy.

[Need Help] What are the laws of redistributing fonts via swf if any?

I want to make a large library of font swf files for use in flash programs but I don’t realy feel like getting sued over it. Would redistributing fonts via swf constitute as redistributing the font it’s self. My thoughts are 1: you can only use the font in flash, 2: I would not be redistributing the font it’s self but only a swf file.

One of the key functions of doing this is to help with the load of install the font just to embedded it in to your program and as well cross platform support.

What are your thoughts?

- Josh Chernoff

Wade Arnold’s new amfphp datagrid example at amfphp.org

amfphp.pnghttp://amfphp.org/docs2/tutorials/datagrid.html

Wade Arnold Amfphp.org has added a new example to adding a record set to a datagrid.

here’s the main document class: requires a datagrid component in the library.

// Wade Arnold: 1/16/2008
// Example is designed to show how to use amfphp to populate a fl.controls.datagrid.
// TODO: Add method to update the dataset array.
// TODO: Add an additional call that shows how to get data from a database.
// TODO: Add a method to update the database dataset. 

package {
	// required for flash file and output display
	import flash.display.MovieClip;
	import fl.events.*;
	import flash.events.*;
	// required to send/recieve data over AMF
	import flash.net.NetConnection;
	import flash.net.Responder;
	// required for the datagrid
	import fl.controls.DataGrid;
	//import fl.controls.dataGridClasses.DataGridColumn;
	import fl.data.DataProvider;

	// Flash CS3 Document Class.
	public class Main extends MovieClip {
		private var gateway:String = "http://localhost/amfphp/gateway.php";
		private var connection:NetConnection;
		private var responder:Responder;
		// DataGrid on the stage
		private var myDg:DataGrid;
		// Dataprovider for the DataGrid
		private var dp:DataProvider;

		public function Main() {
			trace("AMFPHP DataGrid Example");
			// Create the new dataprovider
			dp = new DataProvider();
			myDG.dataProvider = dp;

			// Responder to handle data returned from AMFPHP.
			responder = new Responder(onResult, onFault);
			connection = new NetConnection;

			// Gateway.php url for NetConnection
			connection.connect(gateway);
			// Ask for the data on the load of the flash file.
			connection.call("DataGrid.getDataSet", responder);
		}

		// Handle a successful AMF call. This method is defined by the responder.
		private function onResult(result:Object):void {
			// Add the data that was returned from ther service into the Dataprovider.
			dp.addItems(result);
			// Debug: Just showing how large the dataset is.
			trace("Rows Returned: "+dp.length);
		}

		// Handle an unsuccessfull AMF call. This is method is dedined by the responder.
		private function onFault(fault:Object):void {
			trace(String(fault.description));
		}
	}
}

k2 wordpress theme Kuler header mod.

This mod adds a header that pulls from the kuler’s most recent feeds api as seen here at this blog.

Installation:
Just download and extract in to the k2 theme folder to install.
Download: k2_kulerMod.zip v1

Road Map:

  1. Make an official plug in for wordpress
  2. Add support for custom URL feeds
  3. Add page tabs to base of header
  4. Add custom column support

Known problems:

  1. The tabs in the header have been removed but will be added again ASAP when a solution to the problem is found.
  2. The current Header is made for the default 2 column layout and will not work with other column layouts.

If you would like me to port this mod to other wordpress themes please post the name of the theme here.

Overcome flash and RSS Crossdomain problems with AMFPHP and Magpie

The other day I was playing with the idea of getting RSS feeds with magpie and amfphp and here is the result of my testing. I would like to compare if my method is faster then just using URLLoader and parsing out xml in flash. Any one have any idea how I can test which is faster?

Any how on to the tests.
a few things you will need before you can get this to work.

Lets start out with taking a fast run through setting up our files.

  1. Go to http://amfphp.org and download the php frame work, extract it on your server. Inside of amfphp there is a folder named services
  2. The services folder is where I would like you to create a folder name “Rss_service” with out quotes.
  3. After you have made the folder go to and download magpie rss. Extract the magpie framework into the Rss_services folder **Note the current version of magpie is “magpierss-0.72″, if you are using a different version change the directory names in the code to correspond to your current version of magpie.**
  4. Make a PHP file called “RssHandler” with out quotes. heres our code for that file.
    items, $rss->channel);
    			return ($array);
    		}else{
    			return magpie_error();
    		}
    	}
    }
    ?>
    

    Do a test in the amfphp service browser to make sure you have no errors before moving on.

  5. If all is good with no errors go to and get the as3 remoting framework at http://osflash.org/as3lrf
  6. After you get the as3 framework up it will be time to make the flash file. Heres a example here of Action Script 3
    import com.dannypatterson.remoting.*;
    var serviceProxy:ServiceProxy;
    
    serviceProxy = new ServiceProxy("http://www.gfxcomplex.com/amfphp/gateway.php", "Rss_services.RssHandler");
    serviceProxy.addEventListener(ResultEvent.RESULT, onRes, false, 0, true);
    serviceProxy.getRss("http://rss.netflix.com/QueueRSS?id=P3743744853232005706625743118647423");
    
    function onRes(e:ResultEvent):void {
    	var array:Array = e.result as Array;
    	trace(array);
    }
    
  7. You will need a crossdomain.xml file on your own server to make this work. heres an example of what I use.
    
    
    
    
      
      
    
    

If all works as planed you will now have a great way to get around crossdomain problems with RSS and flash as seen here at http://gfxcomplex.com/labs/magpie_test.html. My example show a small list of movies from a rss feed at netflix which has no crossdomain.xml file making it a pain to work with in flash directly.

The big thing to note is that the xml is parsed out in php and sent back as an array so no client end parsing. I think its fast but I cant tell as I don’t know of a way to test this.