Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-27-2008, 07:41 AM
Senior Member
 
Join Date: Jan 2008
Posts: 123
Default cant create menu with xml

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();
just copy to a AS2 file or directly into a flash project ActionScript

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 ???
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 12:08 PM
Senior Member
 
Join Date: Jan 2008
Posts: 123
Default Re: cant create menu with xml

No one ??? ??? :-\
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 08:18 PM
Senior Member
 
Join Date: Jan 2008
Posts: 123
Default Re: cant create menu with xml

Updated
Reply With Quote
  #4 (permalink)  
Old 03-01-2008, 09:26 AM
Senior Member
 
Join Date: Jan 2008
Posts: 123
Default Re: cant create menu with xml

over 30 visitors and no answer ???
Reply With Quote
  #5 (permalink)  
Old 03-05-2008, 08:45 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: cant create menu with xml

Please send us your project(support@swfkit.com), we will help you to test it.
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:03 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.