Adobe Connect User Community
Menu

#1 2009-07-27 12:06:59

**_dhwalker_**

Couple of SDK Issues

I am cross posting this from the Connect Meeting Forum.
_________________________________________________________________

I'm just getting started with the SDK and have run into a couple of issues.

Big thanks to Allistair and his tutorial posted here: http://seminars.adobe.acrobat.com/p12559577/

First problem:
    I'm trying to retrieve the userID property and having zero success.

Second Problem:
    I'm using the Title application that Allistair provided in his tutorial.
I noticed that if I change layouts and come back to the layout with the Title application in the share pod, all of my custom titles have reset to the defaults. I understand why this happens.

What I was trying to do was to load the Custom Titles from xml.

I created a simple web page that outputs xml and load it when the Title application runs. When I test this in Flash it works beautifully. But when I load it into the Meeting Room it fails miserably.

Here is the code:



// Declare Variables
var txtTitle:TextField;
var txtSubTitle:TextField;
var today_date:Date = new Date();
var arrDayOfWeek:Array = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
var arrMonthNames:Array = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
var strDay:String = arrDayOfWeek[today_date.getDay()];
var strMonth:String = arrMonthNames[today_date.getMonth()];
var strDate:String = (strDay+" "+strMonth+" "+today_date.getDate()+", "+today_date.getFullYear());


//THESE LINES LOAD XML DATA FROM A WEB PAGE
//**************************************************
var myXML:XML = new XML();
myXML.ignoreWhite=true;
myXML.load("http://www.districtresources.com/connecttitles/dwGetTitles.asp");
myXML.onLoad = function(success){
    if (success){
        txtTitle.text=myXML.firstChild.childNodes[0].firstChild.nodeValue;
        var st:String = myXML.firstChild.childNodes[1].firstChild.nodeValue;
        if(st!="none") {
            txtSubTitle.text = st;
        }else {
            txtSubTitle.text = strDate;
        }
    }
}
//***************************************************


function syncMessageReceived(p_evt) {
    switch (p_evt.messageName) {

        case "changeTitle" :
            txtTitle.text = String(p_evt.messageValue);
            break;

        case "changeSubTitle" :
            txtSubTitle.text = String(p_evt.messageValue);
            break;
    }
}

function roleChanged(p_evt) {
    switch (this.syncConnector.role) {

        case (BreezeSyncConnector.k_PARTICIPANT) :
            txtTitle.selectable = false;
            txtSubTitle.selectable = false;
            break;

        case (BreezeSyncConnector.k_PRESENTER) :
            txtTitle.selectable = false;
            txtSubTitle.selectable = false;
            break;

        case (BreezeSyncConnector.k_HOST) :
            txtTitle.selectable = true;
            txtSubTitle.selectable = true;
            break;
    }
}



var podRatio:Number = this._width / this._height;
function sizeChanged(p_evt) {
        this._width = Math.round(syncConnector.podWidth);
        this._height = Math.round(syncConnector.podWidth/podRatio);
}

// Functions
txtTitle.onChanged = function() {
    syncConnector.dispatchSyncMessage("changeTitle",txtTitle.text);
};

txtSubTitle.onChanged = function() {
    syncConnector.dispatchSyncMessage("changeSubTitle",txtSubTitle.text);
};


/************Collaboration Builder SDK objects************/
syncConnector.addEventListener("syncMessageReceived",this);
syncConnector.addEventListener("sizeChanged",this);
syncConnector.addEventListener("roleChanged",this);
syncConnector.addEventListener("caughtUp", this);

Any feedback would be appreciated.

Offline

#2 2009-07-27 12:08:32

**_dhwalker_**

Re: Couple of SDK Issues

And here is Allistair Lee's reply. Thanks Allistair.
___________________________________________________
I had the same problem loading XML data when I first wrote the MP3 player.  It would work locally - but not in a Connect Pro room.

I think it was one of the Connect Pro SE's that helped me solve the problem by giving me a very small actionscript file. Using this function to convert the URL, my application worked both locally and inside of a Connect Pro room.

I've uploaded the file they gave me here:
http://www.connectusers.com/x/URLUtils.as

Make sure it's in the same directory as your flash application, and change the line that loads the code to the following:


Code:
myXML.load(URLUtils.convertURL("http://www.districtresources.com/connecttitles/dwGetTitles.asp", this));

I hope it helps.

BTW - this discussion might get more interaction if we move it to the 'Developers Discussion' forum.

Last edited by **_dhwalker_** (2009-07-27 12:08:57)

Offline

#3 2009-07-27 12:48:21

**_dhwalker_**

Re: Couple of SDK Issues

Allistair,
I did as you instructed and now in Flash I get the following error in the Output panel:
Error opening URL 'file:///C|/Documents%20and%20Settings/dwalker/My%20Documents/Adobe/ConnectPods/Title/http://www.districtresources.com/connecttitles/dwGetTitles.asp'

It looks like the URL Conversion function is causing it to look on my local C drive.

Obviously it doesn't work in a meeting room.

Here is the code as it is currently:

//THESE LINES LOAD XML DATA FROM AN ACCESS DATABASE
//**************************************************
var myXML:XML = new XML();
myXML.ignoreWhite=true;
//myXML.load("http://www.districtresources.com/connecttitles/dwGetTitles.asp");
myXML.load(URLUtils.convertURL("http://www.districtresources.com/connecttitles/dwGetTitles.asp", this));
myXML.onLoad = function(success){
    if (success){
        txtTitle.text=myXML.firstChild.childNodes[0].firstChild.nodeValue;
        var st:String = myXML.firstChild.childNodes[1].firstChild.nodeValue;
        if(st!="none") {
            txtSubTitle.text = st;
        }else {
            txtSubTitle.text = strDate;
        }
    }
}

Offline

Board footer