vijayakumar flex
vijayakumar flex

Reputation: 583

Flex - How does nativeApplication.icon work?

NativeApplication.nativeApplication.icon.bitmaps = bitmapData();

I'm trying to edit the bitmaps for the system tray icon, but I got an error:

Implicit coercion of a value of type flash.display:BitmapData to an unrelated type Array.

What mistake did I make, or could you tell me the meaning of this error?

Upvotes: 0

Views: 1266

Answers (3)

Freddie
Freddie

Reputation: 1029

This is the discussion about this topic from Adobe:

http://livedocs.adobe.com/flex/3/html/help.html?content=taskbar_1.html

Upvotes: 0

Richard Szalay
Richard Szalay

Reputation: 84754

Icon.bitmaps is an Array of BitmapData, with one BitmapData instance for each size. You must reassign the entire array:

NativeApplication.nativeApplication.icon.bitmaps = new Array(bitmapData);

Alternatively, as the livedocs mention, you can specify all the bitmap sizes:

NativeApplication.nativeApplication.icon.bitmaps = 
    new Array(icon16x16.bitmapData, icon128x128.bitmapData);

Upvotes: 3

RichSad
RichSad

Reputation:

I think you need a typecast in there such as:

SystemTrayIcon(NativeApplication.nativeApplication.icon).bitmaps

The SystemTrayIcon is a Windows-specific class I believe.

Upvotes: 0

Related Questions