Customizing SparkWeb using Adobe Flex SDK

I’m close to being able to compile the SparkWeb.mxml file using the free Adobe Flex SDK.

For anyone confused by this tutorial or wondering where to start, please allow me to walk through the general steps on how to get up and running with the SDK and use it to customize the SparkWeb.swf file:

  1. Download the source from Adobe

  2. Follow the directions in this video on how to install (this vid uses OS X, but it will give you an idea)

  3. Download the SparkWeb source into a Desktop folder using something like “mkdir sparkweb && cd sparkweb && wget -r http://svn.igniterealtime.org/svn/repos/sparkweb/trunk/

  4. Now you can follow the instructions on how to change the stylesheet (NOTE: where it says “Replace the SparkWebSkin.swf file in assets/css/” it should actually read “Replace the SparkWebSkin.css file in assets/css/”)

  5. Copile using the mxmlc binary and the SparkWeb.mxml file

OK, now that we’re done with the throat-clearning for posterity’s sake, here’s my issue:

======

~/Desktop/sparkweb/SparkWeb/src myuser$ mxmlc SparkWeb.mxml
Loading configuration file /Developer/SDKs/flex_sdk_3/frameworks/flex-config.xml
/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(154): Error: Type was not found or was not a compile-time constant: NotifyEvent.

chatContainer.addEventListener(NotifyEvent.NEW_MESSAGE, function(evt:NotifyEvent):void {

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(200): Error: Type was not found or was not a compile-time constant: XIFFErrorEvent.

public function handleError(event:XIFFErrorEvent):void

======

Looking at line 154 of SparkWeb.mxml, I see this:

======

var foo:NotifyEvent
chatContainer.addEventListener(NotifyEvent.NEW_MESSAGE, function(evt:NotifyEvent):void {
var message:Message = evt.message;
ExternalInterface.call(“alertTitle”, “SparkWeb”, RosterItemVO.get(message.from.unescaped, false).displayName+"!");
});

======

Adobe compiler error documentation seems tells me that I need to specify the object type better. And I assume “foo” isn’t a real object type. Any ideas on how to fix?

UPDATE

I think the problem is more serious (or more fundamental, perhaps) than I thought. If I comment out the two sections giving me errors, I get a whole slew of new ones:

======

lillit:~/Desktop/sparkweb/SparkWeb/src myuser$ mxmlc SparkWeb.mxml
Loading configuration file /Developer/SDKs/flex_sdk_3/frameworks/flex-config.xml
/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(76): Error: Definition org.jivesoftware.xiff.util could not be found.

import org.jivesoftware.xiff.util.*;

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(265): Error: Type was not found or was not a compile-time constant: ContactListContainer.

<local:ContactListContainer top=“10” left=“10” bottom=“10” id=“contactListContainer” visible=“false” height=“100%” width=“400” maxWidth=“400” />

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(267): Error: Type was not found or was not a compile-time constant: ChatContainer.

<local:ChatContainer id=“chatContainer” height=“100%” width=“80%” visible=“false” />

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(272): Error: Type was not found or was not a compile-time constant: LoginDialog.

<local:LoginDialog filters="{[shadow]}" showEffect=“fade” id=“loginDialog” verticalCenter=“0” horizontalCenter=“0” visible="{shouldShowLoginWindow}" />

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(273): Error: Type was not found or was not a compile-time constant: CreateAccountDialog.

<local:CreateAccountDialog filters="{[shadow]}" showEffect=“fade” hideEffect=“fade” id=“createAccountDialog” verticalCenter=“0” horizontalCenter=“0” visible=“false” />

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(81): Error: Type was not found or was not a compile-time constant: ConnectionManager.

private var connectionManager:ConnectionManager;

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(94): Error: Access of undefined property SparkManager.

SparkManager.configProvider = function (key:String):String {

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(114): Error: Access of undefined property SparkManager.

SparkManager.errorHandler = displayError;

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(115): Error: Access of undefined property SparkManager.

var server:String = SparkManager.getConfigValueForKey(“server”);

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(117): Error: Access of undefined property SparkManager.

var policyFileURL:String = SparkManager.getConfigValueForKey(“policyFileURL”);

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(125): Error: Access of undefined property SparkManager.

shouldShowLoginWindow = SparkManager.getConfigValueForKey(“autoLogin”) != “true”;

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(126): Error: Access of undefined property SparkManager.

shouldUseExternal = SparkManager.getConfigValueForKey(“useExternalAuth”) == “true”;

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(128): Error: Access of undefined property XMPPConnection.

XMPPConnection.registerSASLMechanism(“EXTERNAL”,External);

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(128): Error: Access of undefined property External.

XMPPConnection.registerSASLMechanism(“EXTERNAL”,External);

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(130): Error: Access of undefined property XMPPConnection.

XMPPConnection.disableSASLMechanism(“ANONYMOUS”);

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(137): Error: Access of undefined property AlertWindow.

AlertWindow.show(message, name);

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(145): Error: Type was not found or was not a compile-time constant: XMPPConnection.

var connection:XMPPConnection = connectionManager.connection;

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(144): Error: Access of undefined property SparkManager.

connectionManager = SparkManager.connectionManager;

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(148): Error: Access of undefined property handleError.

connection.addEventListener(“error”, handleError);

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(149): Error: Access of undefined property SparkManager.

SparkManager.inviteListener.addEventListener(InviteEvent.INVITED, MUCInviteReceiveWindow.show);

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(149): Error: Access of undefined property InviteEvent.

SparkManager.inviteListener.addEventListener(InviteEvent.INVITED, MUCInviteReceiveWindow.show);

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(149): Error: Access of undefined property MUCInviteReceiveWindow.

SparkManager.inviteListener.addEventListener(InviteEvent.INVITED, MUCInviteReceiveWindow.show);

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(163): Error: Type was not found or was not a compile-time constant: ChatRoom.

var chatRoom:ChatRoom = chatContainer.chatFrame.selectedChild as ChatRoom;

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(163): Error: Access of undefined property ChatRoom.

var chatRoom:ChatRoom = chatContainer.chatFrame.selectedChild as ChatRoom;

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(177): Error: Call to a possibly undefined method ShowBorders.

new ShowBorders();

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(188): Error: Access of undefined property SparkManager.

SparkManager.roster.addEventListener(RosterEvent.ROSTER_LOADED, function():void {

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(188): Error: Access of undefined property RosterEvent.

SparkManager.roster.addEventListener(RosterEvent.ROSTER_LOADED, function():void {

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(194): Error: Access of undefined property SparkManager.

SparkManager.connectionManager.connection.send(new Presence());

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(194): Error: Call to a possibly undefined method Presence.

SparkManager.connectionManager.connection.send(new Presence());

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(195): Error: Access of undefined property SparkManager.

SparkManager.roster.addEventListener(RosterEvent.SUBSCRIPTION_REQUEST, SubscriptionRequestWindow.showSubscriptionRequestWindow);

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(195): Error: Access of undefined property RosterEvent.

SparkManager.roster.addEventListener(RosterEvent.SUBSCRIPTION_REQUEST, SubscriptionRequestWindow.showSubscriptionRequestWindow);

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(195): Error: Access of undefined property SubscriptionRequestWindow.

SparkManager.roster.addEventListener(RosterEvent.SUBSCRIPTION_REQUEST, SubscriptionRequestWindow.showSubscriptionRequestWindow);

/Users/myuser/Desktop/sparkweb/SparkWeb/src/SparkWeb.mxml(189): Error: Access of undefined property SparkManager.

contactListContainer.contacts.dataProvider = SparkManager.roster.groups;

======

This looks similiar to the linkage errors described here, right? Still, I can’t seem to figure it out. Mac OS X should support symlinks.

Also, I did a fresh install of Flex SDK on a Ubuntu virtual machine and pulled a new version of the code trunk and got the exact same errors:

======

myuser@ubuntu:/opt/flexdev$ cd sparkweb
myuser@ubuntu:/opt/flexdev/sparkweb$ ls
branches index.html tags trunk
myuser@ubuntu:/opt/flexdev/sparkweb$ cd trunk
myuser@ubuntu:/opt/flexdev/sparkweb/trunk$ ls
assets build index.html SparkWeb SparkWebCommonComponents SparkWebCore
myuser@ubuntu:/opt/flexdev/sparkweb/trunk$ cd SparkWeb
myuser@ubuntu:/opt/flexdev/sparkweb/trunk/SparkWeb$ ls
assets html-template index.html locale src
myuser@ubuntu:/opt/flexdev/sparkweb/trunk/SparkWeb$ cd src
myuser@ubuntu:/opt/flexdev/sparkweb/trunk/SparkWeb/src$ sudo /opt/flexsdk/bin/mxmlc SparkWeb.mxml
Loading configuration file /opt/flexsdk/frameworks/flex-config.xml
/opt/flexdev/sparkweb/trunk/SparkWeb/src/SparkWeb.mxml(154): Error: Type was not found or was not a compile-time constant: NotifyEvent.

chatContainer.addEventListener(NotifyEvent.NEW_MESSAGE, function(evt:NotifyEvent):void {

/opt/flexdev/sparkweb/trunk/SparkWeb/src/SparkWeb.mxml(200): Error: Type was not found or was not a compile-time constant: XIFFErrorEvent.

public function handleError(event:XIFFErrorEvent):void

myuser@ubuntu:/opt/flexdev/sparkweb/trunk/SparkWeb/src$

======

Did you ever get past this? I am looking to customize the SparkWeb client but your post has me scared :slight_smile: