|
|||
|
my widget is getting data from e xml file and publishes this data as a tray menu.
the part with "lank" wont work, i try basicly, append a link to a specific part of menu. the xml looks like this <post lnx='viewtopic.php?t=655-AND-postdays=0-AND-postorder=asc-AND-start=0#4447' subject='Skrivet i: [Rekommendation] Allt i En Bok' TorP='New Post' FName='Information' Tex='ja+sen+ACE+%E4r+ju+inte+bara+flash+f%F6r+o+bl i+ace+m%E5ste+du+certifiera+dig+i+minst+6+adobe+pr odukter.++++alts%E5+ACP+i+flash+kan+man+bli++++sed n+ACP+%28Adobe+Certified+Person%2FPersonell%29' Profurl='profile.php?mode=viewprofile-AND-u=2' Profile='ACE' TopicDate='Ig�r, 15:48'/> it goes well to publish subject and all other parts as menu items but something isnt working right. the design the im trying to get to work is: menu -> "subject" -> goto (goes to topic with getURL using lnx attributes) -> Written -> Appends attributes Tex everything behind "->" is submenu" now i have a problem. heres the source code NEW CODE!!!!!! Code:
import SWFKit.*;
import SWFKit.application.SysTray.*;
import SWFKit.application.*;
SysTray.useDefaultHandler = false;
System.useCodepage = true;
var systemtray = new SysTray();
SysTray.icon = Global.getAdditionalFile("bla.ico");
SysTray.tip = " ForumSpy(fSpy™)";
SysTray.add();
asand = "-AND-";
function XmlKlart(success:Boolean) {
}
function laddaXml() {
//myXml = undefined;
if (myXml == undefined) {
var ran1:Number = Math.random()*10000;
var ran:Number = Math.round(ran1);
var XmlAdress:String = "http://www.heist.se/xml/source.xml?"+ran+"1"
// "Adress to XML"+ran+"3";
var myXml:XML = new XML();
myXml.ignoreWhite = true;
unique = getTimer()+ran;
myXml.load(XmlAdress+unique);
myXml.onLoad = function(success:Boolean) {
if (success) {
// Inläggen i meny
nyaInlagg = new Menu();
nyaInlagg.createPopupMenu();
for (var m = 0; m<6; m++) {
var nya:String = myXml.firstChild.childNodes[m].attributes.subject;
var skribent:String = myXml.firstChild.childNodes[m].attributes.Profile;
var fNamn:String = myXml.firstChild.childNodes[m].attributes.FName;
var lenken:String = myXml.firstChild.childNodes[m].attributes.lnx;
var torP:String = myXml.firstChild.childNodes[m].attributes.TorP;
var texT:String = myXml.firstChild.childNodes[m].attributes.Tex;
var texten:String = unescape(texT);
var lank:String = lenken.split(asand).join("&");
var guru:String = "http://website/forum/";
getMainWnd().bringToTop();
nyaInlagg.appendItem("lank", skribent + " -|- " + nya);
var id = nyaInlagg.show();
if (id == "lank") {
getURL(guru+lank, "_blank");
}
}
// Online personer (inloggade)
var onlineUsers = new Menu();
onlineUsers.createPopupMenu();
for (var s:Number = 0; s<20; s++) {
var onlineBes:String = myXml.childNodes[1].childNodes.attributes.Name;
var Adress:String = myXml.childNodes[1].childNodes.attributes.urlen;
var profAdress = Adress.split(asand).join("&");
if (onlineBes != undefined) {
Onlinesub.appendItem(profAdress,onlineBes);
}
}
} else {
Dialogs.msgBox("Something went wrong with loading the XML file, check the XML path again on line nr.23");
Global.trace("TopicDate: " + nya + " Profil: " + av + " Fnamn: " + fNamn + " Länk: " + lank + " text " + texten);
Global.trace(XmlAdress);
}
};
Global.trace(XmlAdress+unique);
}
}
function onRClicked() {
var trayMenu = new Menu();
trayMenu.createPopupMenu();
trayMenu.appendItem(onlineUsers, "Online:");
trayMenu.appendItem(nyaInlagg, "Last:");
trayMenu.appendItem();
trayMenu.appendItem("laddaXml", "Update");
trayMenu.appendItem("close", "Close");
getMainWnd().bringToTop();
var ide = trayMenu.show();
if (ide == "close") {
Global.getMainWnd().close();
}
if (ide == "laddaXml") {
laddaXml();
}
}
systemtray.setEventHandler("onLDblClicked",onLDblClicked);
systemtray.setEventHandler("onRClicked", onRClicked);
laddaXml();
Nothing else is needed here, XML is loaded from a my friends webserver All i need to publish here is when right clicked on the tray... first is shown main menu as follows: FName -|- Subject Ex: Information -|- 4 Topic When mouse is over one alternative, submenu follows from choosen alternative: Main Menu Submenu Submenu 2 FName -|- Subject --> Profile -------> Visit ( on click = getURL(profURL)) Tex -------> Goto (on click = getURL(lnx)) Ex: Information -|- 4 Topic --> Joakim - - - - - - - - - - - - - - - - - - - - -> Visit ->( has function when clicked = getURL(Addy+profURL)) A+question+++++How+to+publish+all+this+as+menu+fro m+tray? ->Goto ->(has function when clicked = getURL(lnx)) Anyone know how to append items under appended menus ??? |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|