Nobien A nerd blog about nerdy things by … nerdy guys?

25Nov/073

AS3: Loader Class & layer views.

I ran into this weird problem while working on something for Almighty. I've done a small amount of research on the topic and found nothing. I apologize if the answer is blatantly obvious ... but I'm stumped.

I have two MovieClips that load in dynamic content using the Loader class:

package
{
    import flash.net.URLRequest;
    import flash.display.Loader;
    import flash.display.MovieClip;
 
    class ImageHolder extends MovieClip
    {
        public function ImageHolder( urlReq:URLRequest )
        {
            var loader:Loader = new Loader();
            loader.load( urlReq );
            addChild( loader );
        }
    }
}

Pretty simple huh? Normally I'd add all of the fun loving event listeners, but not today.
Now I load some external data in... a SWF containing a PNG, and a JPG.

package
{
    import flash.net.URLRequest;
    import flash.display.MovieClip;
 
    class MyMovieDocument extends MovieClip
    {
        public function MyMovieDocument()
        {
            var imageHolder1:ImageHolder =
                new ImageHolder( new URLRequest( "/images/some.jpg" ));
 
            var imageHolder2:ImageHolder =
                new ImageHolder( new URLRequest( "/swfs/some.swf" ));
 
            addChild( imageHolder1 );
            addChild( imageHolder2 );
        }
    }
}

Easy enough. Well I'm baffled by the results. When you load both images in and add them to the display list, the JPG is on top even though it was added first. Heck, I've even tried using addChildAt( imageHolder1 , 0 ); and still the same result... The JPG is always on top. This is weird since they're wrapped in individual MovieClips.

I have the result swf but I can't get it to show up in WordPress, and I don't have the time right now to figure it out.

Either way, this is a weird issue. Has anyone else had this problem? Or am I just missing something?

Filed under: ActionScript 3 3 Comments
25Nov/071

FlashForward Presentation Response

FlashForward has come and gone and at last, we've received our audience response. Over all, I'd like to thank everyone again for attending our presentation, and we're stoked about the feedback.

Our presentation was definitely based on common sense. It's definitely an odd topic to try to approach in that respect. Our original "pitch" to Lynda was to offer a "primer" session for Designers who want to get into object orientated programming with CS3/AS3. Ala, we wanted to help designers start to understand the development side of things so they can co-mingle better. However, when we talked to the people at Lynda, after we were accepted, we noticed that their interpretation of our pitch was a bit different than our intentions (not to mention Peter Elst basically covered that kind of content).

However, it wasn't a bad interpretation at all. We feel as if most people do not talk about the problems faced in the office and we also believe there are some issues between Designers, Developers, Copywriters, Production Managers and the sort. Especially given that we have this technology that changes every year. It's the sort of thing that we believe needs to be constantly talked about, otherwise we just fall into our patterns and continue to look at things the same way or just get plain lazy.

Needless to say, our session wasn't for everyone. In fact, we received a few harsh responses to the content and approach. However, for the most part, we got a lot of great feedback, especially while we we're at the conference. I think a lot of people were expecting us to show specific examples of how to improve the technical workflow of a project, but we knew there were already sessions concerning that kind of stuff so we avoided it. We really wanted our message to feel more human than, say, technical.

With this said, we had a great time at FlashForward and we are thankful to have the opportunity. Of all of the 'geeky' communities out there, the Flash community is definitely one of the more creative and supportive.

Thank you everyone,
~marc & matt

ps: sorry for the delayed response.

Filed under: Conferences 1 Comment
5Nov/071

Google Announces Open Mobile OS. Adobe to accelerate Linux support?

So Google has announced their open mobile OS initiative: Android. The OS is based on Linux, totally open source, and will be released under the Apache v2 license. Additionally, there are already a slew of carrier, software, manufacturing, and other various "alliance" members. And to top it all off, they'll be unveiling an SDK on November 12th. Sounds pretty promising, no?

I can't help but wonder what Adobe is thinking today. Will this help the Flash Player or AIR get on mobile phones? Will Adobe take interest at all? I sure hope so. I'm getting rather excited over the possibilities.

Filed under: General 1 Comment
2Nov/073

Whats up with all this squawking over OpenSocial?

Throughout the day I've been reading various blog posts and comments about Google's new OpenSocial effort. For the most part, it seems as if people are getting the wrong idea about how OpenSocial works, or simply, just what the hell it is. Particularly, I don't really understand posts like this, that just have it plain wrong. I mean, really, Google would never exercise that much control. Its going to be up to the social networks to implement the standard within their own application. Sure, it could "tie together" social networks, but that will largely be up to other application developers and their brilliant minds.

Perhaps its difficult for people who don't develop web applications (actually write code) to understand that this is just an effort to standardize public API's across social networking services. I'm rather excited about the possibility of being able to develop an Actionscript library that can perform the same exact method calls (getPerson, getFriends, addActivity, etc.) and just have to specify the service to use (LinkedIn, Orkut, etc. ). At least thats how I'm envisioning all this.

I also find it funny that a lot of people are getting all anxious over the possibility of Facebook refusing to implement the standard. Facebook is certainly in its own little world. While its a pretty good example of a web application that offers a public data API, it still has a bit of a "pet project" feel to it and I don't feel as if the owner/creator is that concerned with adopting an API standard. Developers are already happily using their API with good success. Perhaps it will hurt them in the long run, but even if they become late adopters, its going to be a standard API, thus making it easy for developers to add Facebook into their existing OpenSocial standard apps.

In the end, I'm pretty stoked about this, but probably only because I'm a developer.

Filed under: Technology 3 Comments
1Nov/075

Flash Embed Tip: Minimum width and height for liquid layouts

Update: This post is old, and getting a decent amount of traffic, so I've decided to provide a link to a more recent post that handles this situation much better! Just One of My Favorite Flash Tools: swffit

Over the course of your career you often come up with solutions to such small problems that you completely forget about them. One instance for me is coming with a really simple way to ensure that a Flash site has a minimum height and/or width while using a liquid layout. When a designer gives you a comp and he or she says "I want this to be 'fullscreen'", you immediately think that you'll be setting the width and height of the embed code to 100%. However, you soon realize that you have to account for smaller screen sizes than the size at which the site was designed for.

You could create you're own horizontal and vertical scrollbars within your Flash piece to handle such a situation, but I much prefer the scrollbars within the browser, as a user is much more apt to recognize them and feel more comfortable using them. Here is my tip for handling this.

Say you have a piece of Flash content embedded in your page with SWFObject as such:

var so = new SWFObject("Home.swf", "myFlashContent", "100%", "100%", "8", "#000000");
so.write("flashcontent");

Straightforward, of course. Now start by adding this Javascript function up within the page's HEAD tag:

function adjustSWFHeight() {
    if(document.body.clientHeight <= 768)
        document.getElementById("myFlashContent").style.height = "680px";
    else
        document.getElementById("myFlashContent").style.height = "100%";
 
    if(document.body.clientWidth <= 1000)
        document.getElementById("myFlashContent").style.width= "1000px";
    else
        document.getElementById("myFlashContent").style.width= "100%";
}

Simple enough, right? The only thing you'll have to customize is the condition statement which defines the minimum height of the Flash content and the edge at which to use the minimum height over a 100% value. Next, set the onLoad and onResize properties of the page's BODY tag.

And thats it! o far it seems to work in Firefox, IE and Safari pretty well. Perhaps it will help you!

Filed under: Flash, JavaScript 5 Comments