there is a problem with my code but i couldnt find it !!! i have 2 buttons "previous" and "next" for tree object;
previous button code :
next button code :Code:nCount = Tree.GetChildCount("Tree1", "0"); if (nCount > 0) then Tree.SetSelectedNode("Tree1", tostring(nInd)); MediaPlayer.Load("media1", Tree.GetNode("Tree1", nInd).Data); if (nInd == nCount) then nInd = 1; else nInd = nInd - 1; end end
when i click next button it works ok and jumps the next node but once if i click the previous button it jumps to first node not the one before selected and then next button gives the same error !!!Code:nCount = Tree.GetChildCount("Tree1", "0"); if (nCount > 0) then Tree.SetSelectedNode("Tree1", tostring(nInd)); MediaPlayer.Load("media1", Tree.GetNode("Tree1", nInd).Data); if (nInd == nCount) then nInd = 1; else nInd = nInd + 1; end end

Reply With Quote