Category: Adobe

Flash Event.COMPLETE sometimes doesn’t fire in Firefox

3:24 pm on December 14th, 2009, by Ryan Gibson

I have run into some strange behaviour in Flash and Firefox recently. We had a Flash movie (AS3) that loads up, in its document classes constructor it sets a few event handlers on loaderInfo:

this.loaderInfo.addEventListener(Event.COMPLETE, loadComplete);
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, progress);
this.loaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
this.loaderInfo.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);

The problem taht seemed to be happening (most of the time, ie not 100% reproducible) was that the movie was failing to fire the Event.COMPLETE event handler. After some browsing I found Marguera’s post which suggests adding another event handler, Event.INIT and pointing it at the same handler as the Event.COMPLETE event.

this.loaderInfo.addEventListener(Event.INIT, loadComplete);

Then updating the loadComplete method to check if we had actually finished loading, if so remove the event handlers and carry on setting up the movie.

private function loadComplete(e:Event):void {
  if(this.loaderInfo.bytesLoaded == this.loaderInfo.bytesTotal){
    this.loaderInfo.removeEventListener (Event.INIT, loadComplete);
    this.loaderInfo.removeEventListener (Event.COMPLETE, loadComplete);
    // Finish setting up the movie
    // ...
  }
}

This approach fixed our issue, and hopefully this post will point anyone else seeing similar irregularities in the right direction. The Flash documentation states that the Event.INIT event is fired when:

  • All properties and methods associated with the loaded object and those associated with the LoaderInfo object are accessible.
  • The constructors for all child objects have completed.

And that the init event always precedes the complete event. That wasn’t what we were seeing in practice, as our complete event was failing to fire completely. hth.

8 comments » | Adobe, development, flash, web

Adobe Air htmlLoader flash content doesn’t appear

4:42 pm on August 14th, 2008, by Jeff Khan

More Air conditioning…Under certain circumstances Flash and PDF content will not display in a htmlLoader when

  • You scale the HTMLLoader object to a factor other that 1.0.
  • You set the alpha property of the HTMLLoader object to a value other than 1.0.
  • You rotate the HTMLLoader content

    AND IT WILL NOT DISPLAY IF THE WINDOW IS TRANSPARENT CHROMELESS
    When i think about it it makes sense not to render but this has been annoying me to no end, since the stage i was working with had a background (but the windows were set to tranparent)

    found this on live docs..

    http://livedocs.adobe.com/air/1/devappsflash/help.html?content=ScriptingHTMLContainer_2.html

2 comments » | Adobe, AIR, flash

Adobe Air htmlLoader scales content by default

2:15 pm on August 14th, 2008, by Jeff Khan

More AIR conditioning for you..

When adding a HTMLLoader to the stage the contents by default scale to the size of the window. And this is not so helpful if you want to open one up in a new window.

you should be setting these properties too:

stage.scaleMode = StageScaleMode.NO_SCALE
stage.align = StageAlign.TOP_LEFT

If you are loading HTMLLoader using a new window i.e:-

var options:NativeWindowInitOptions = new NativeWindowInitOptions();
options.systemChrome = NativeWindowSystemChrome.NONE;

var window:NativeWindow = new NativeWindow(options);
var htmlLoader:HTMLLoader = new HTMLLoader();

// SET THIS–
window.stage.scaleMode = StageScaleMode.NO_SCALE
window. stage.align = StageAlign.TOP_LEFT

before you do your loading..

htmlLoader.load(new URLRequest(blah))

1 comment » | Adobe, AIR, flash

Adobe AIR jsfl publish swf and create AIR package at once

11:52 am on August 1st, 2008, by Jeff Khan

In order to publish an air package you have to create it from the latest swf file. However the Flash AIR extension gives you commands to create and publish air files but not publish the swf in one go.

On windows in ..
C:\Program Files\Adobe\Adobe Flash CS3\en\First Run\Commands

You can add dom.publish() to the AIR – Create AIR File.jsfl just before this line:-

FLAir.PackageAIRFile(flaFilePath);

Alternatively copy and paste the following into your own custom publish and create AIR jsfl file! Useful and i’ll be working on a network debugging window to test air apps running desktop commands soon..useful as you cant test in the authoring environment.

//fl.trace(“Artemis”);
var dom = fl.getDocumentDOM();

if (dom == null)
{
alert(“Failed to get current document.”);
}
else
{

var flaFilePath = dom.path;
//fl.trace(flaFilePath);
//fl.trace(dom.playerVersion);
//fl.trace(dom.asVersion);
//fl.trace(dom.getSWFPathFromProfile());

if(!flaFilePath)
{
alert(“The Flash AIR file must be saved before opening AIR Application and Installer Settings and before creating the AIR file.”);
}
else
{
if(dom.getPlayerVersion() == ‘AdobeAIR1_0′)
{
dom.publish()
FLAir.PackageAIRFile(flaFilePath);
}
else
{
//alert(“The Publish target is not Adobe AIR 1.0.”);
var gotOK = FLAir.PackageAlert(flaFilePath);
if (gotOK == 1)
{
dom.setPlayerVersion(‘AdobeAIR1_0′);
dom.save();
FLAir.OpenSettingDialog(flaFilePath);
}
}
}
}

Comment » | Adobe, AIR, flash

Adobe Air badge install Error# 2023

12:14 pm on July 31st, 2008, by Jeff Khan

Another AIR gotcha..
As well as allowing your server access to the .air filetype make sure the location to the air file is the absolute path unlike the relative path in Adobe’s own example!

credit to this blog entry:
http://blog.joshbuhler.com/2008/06/30/air-installer-badge-error-2032/

Comment » | Adobe, AIR, flash

Adobe Air launch at startup in Flash AS3 Class

11:52 am on July 31st, 2008, by Jeff Khan

As Adobe AIR is still relatively new, i’ll be documenting my train of thought my finds and roadblocks on Labs, it could get messy – you have been warned! Here’s another:-

To force an application to launch at startup,when a user logs in, you must use this

NativeApplication.nativeApplication.startAtLogin = true;

When it’s used in an AS3 class and not on the root of the flash document you must import

import flash.desktop.*;

Was previously importing all the AIR classes to no avail..

5 comments » | Adobe, AIR, flash

Share and Share alike at Acrobat.com

2:20 pm on June 3rd, 2008, by Gareth Evans

Adobe have launched a new ‘beta’ site under the strangely title Acrobat.com.

The site includes:

  • The acquired Buzzword which is basically an online word processor that allows a collaborative approach to writing documents etc.
  • Connect Now, which seems to be a rebranded version of Breeze, which includes screen sharing.
  • Share, if you can imagine Drop Send done by Adobe in Flash then you’re getting close. Share also includes ‘My Files’ and ‘Create PDF’ which as they sound enable you to get to your files and create PDF’s on the fly.

I’ve seen both Buzzword and Share before in their respective betas and both seem very polished. Acrobat.com has it’s own blog and like every good web 2.0 web application there’s nice API under the hood called ‘Document Services

Adobe Acrobat.com

Comment » | Adobe, web

Back to top