PDA

Volledige versie bekijken : Probleem: Functie herhalen


FredericCox
%Europe/Berlin %081 %2005, 02:57
Hmm, ik probeer met een functie gegevens te sturen naar een andere frame, de eerste keer(on press dus) lukt dat heel goed, maar vanaf de tweede keer gaat het mis.

Frame 2 Code:

_global.SendDetails = function(LeagueID, ContinentMC){
trace("sfgmlkjd")
trace(LeagueID)
trace("FUNCTION")
trace("LID: " + LeagueID)
trace("Coming in as:" + ContinentMC)


_global.LeagueID = LeagueID
_global.ContinentMC = ContinentMC


_global.EnglishLeagueName = _root.world[ContinentMC]["country" + LeagueID].EnglishLeagueName
trace("globalname "+ _global.EnglishLeagueName)
_global.NativeLeagueName = _root.world[ContinentMC]["country" + LeagueID].NativeLeagueName
_global.Season = _root.world[ContinentMC]["country" + LeagueID].Season
_global.MatchRound = _root.world[ContinentMC]["country" + LeagueID].MatchRound
_global.ShortName = _root.world[ContinentMC]["country" + LeagueID].ShortName
_global.ZoneName = _root.world[ContinentMC]["country" + LeagueID].ZoneName
_global.CurrencyName = _root.world[ContinentMC]["country" + LeagueID].CurrencyName
_global.CupID = _root.world[ContinentMC]["country" + LeagueID].CupID
_global.CupName = _root.world[ContinentMC]["country" + LeagueID].CupName
_global.ActiveUsers = _root.world[ContinentMC]["country" + LeagueID].ActiveUsers
_global.WaitingUsers = _root.world[ContinentMC]["country" + LeagueID].WaitingUsers
_global.TrainingDate = _root.world[ContinentMC]["country" + LeagueID].TrainingDate
_global.EconomyDate = _root.world[ContinentMC]["country" + LeagueID].EconomyDate
_global.LeagueMatchDate = _root.world[ContinentMC]["country" + LeagueID].LeagueMatchDate
_global.CupMatchDate = _root.world[ContinentMC]["country" + LeagueID].CupMatchDate
_global.NumberOfLevels = _root.world[ContinentMC]["country" + LeagueID].NumberOfLevels
_global.Soort = _root.world[ContinentMC]["country" + LeagueID].Soort
_global.Type = _root.world[ContinentMC]["country" + LeagueID].Type
_global.Live = _root.world[ContinentMC]["country" + LeagueID].Live
_global.StartTime = _root.world[ContinentMC]["country" + LeagueID].StartTime
_global.MinsPlayed = _root.world[ContinentMC]["country" + LeagueID].MinsPlayed

}




_root.world[ContinentMC]["country" + LeagueID].onPress = function(){
trace("ON PRESS")
trace(this.LeagueID)
trace(this.ContinentMC)
trace("send")
trace("-----------------------")

_global.SendDetails(this.LeagueID,this.ContinentMC )
_root.gotoAndPlay(3);

En de code op Frame 4:


function LeagueDetails(){

ContinentMC = _global.ContinentMC
trace("CMC1" + ContinentMC)
LeagueID = _global.LeagueID
EnglishLeagueName = _global.EnglishLeagueName
NativeLeagueName = _global.NativeLeagueName
Season = _global.Season
MatchRound = _global.MatchRound
ShortName = _global.ShortName
Continent = _global.Continent
ZoneName = _global.ZoneName
CurrencyName = _global.CurrencyName
CupID = _global.CupID
CupName = _global.CupName
ActiveUsers = _global.ActiveUsers
WaitingUsers = _global.WaitingUsers
TrainingDate = _global.TrainingDate
EconomyDate = _global.EconomyDate
LeagueMatchDate = _global.LeagueMatchDate
CupMatchDate = _global.CupMatchDate
NumberOfLevels = _global.NumberOfLevels
Soort = _global.Soort
Type = _global.Type
StartTime = "Started at " + _global.StartTime
MinsPlayed = _global.MinsPlayed + " minutes played"
trace(_global.Live)
if(_global.Live == true){
trace("play live")
_parent.LiveAnimation.gotoAndPlay(2);
}else{
_parent.LiveAnimation.gotoAndStop(1);
Soort = ""
Type = ""
StartTime = ""
MinsPlayed = ""
}
this.Flag.loadMovie("http://www.lnznv.be/HTflags/" + LeagueID + "flag.jpg")
trace(LeagueID)
trace("CMC" + ContinentMC)
_global.SendDetails(LeagueID,ContinentMC)

}
LeagueDetails()

setInterval(LeagueDetails, 3000)
stop();

Beide codes zitten in een MC daarom da'k _global gebruik ma zonder succes:s
Zonder de functie komt de data dus goed door, de eerste keer (on press dus ook) maar bij het herhalen niet meer, iemand die de fout ziet? ik heb me al zot getraced

Trace na onPress + 1 keer herhalen:

sfgmlkjd
35
FUNCTION
LID: 35
Coming in as:EUR
globalname Russia
CMC1EUR
false
35
CMCEUR
sfgmlkjd
35
FUNCTION
LID: 35
Coming in as:EUR
globalname undefined
CMC1EUR
undefined
35
CMCEUR
sfgmlkjd
35
FUNCTION
LID: 35
Coming in as:EUR
globalname undefined

Dit als ik op Rusland klik, eerst doet ie het dus goe

FredericCox
%Europe/Berlin %492 %2005, 12:49
Niemand?µHelp:)):):)

иіţωίţ
%Europe/Berlin %624 %2005, 15:58
Hmm, ik probeer met een functie gegevens te sturen naar een andere frame

:confused: Ik weet niet beter of ik hoef helemaal niks te doen om mijn variables op te vragen een paar frames verder... :confused: ... ik heb geen idee wat je hier mee probeert te bereiken. :D