0

スライド 5 の前では完全に機能するため、このエラーが発生する理由はわかりません。

TypeError: Error #2007: Parameter text must be non-null.
    at flash.text::TextField/set text()
    at rlo_fla::Question_15/updateTextFunction()[rlo_fla.Question_15::frame1:17]
    at Main/frame6()[Main::frame6:31]
    at flash.display::MovieClip/gotoAndStop()
    at Main/Answer()[Main::frame5:44]

TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at Main/clickInfoLoopFunction()[/Users/Kristian/Dropbox/University of Westminster/RLO/Project/Main.as:238]

.fla と .as は私の git で入手できます: https://github.com/EpicKris/rlo

申し訳ありませんが、これ以上の洞察を提供することはできません。問題の性質について非常に確信が持てません。

4

1 に答える 1

0

In the function clickInfoLoopFunction(), you call:

infoMC.updateTextFunction(textO['Topic ' + currentTopicI + ' Slide ' + currentSlideI + ' Info']);

The problem is that the value of either currentTopicI or currentSlideI became something unexpected, and tried to access a property that doesn't exist in textO. If you run into this error again, trace the output of currentTopicI and currentSlideI right before this line. Then you'll figure out that, for example, the program was trying to call textO['Topic928Slide-5Info']. Of course, after that you'll have to figure out why those values changed unexpectedly, but this is a start.

EDIT : There are two main problems

1) You have a number of MovieClips in the FLA with functions in them to update text in a TextField. Right now they try to set the text even if the parameter is null. So prevent that by wrapping the text-setting lines with:

if (theParameter != null) { }

2) In Main.as, in the function clickInfoLoopFunction(), infoMC.updateTextFunction(textO['... gets called, but sometimes infoMC itself is null, so only call this function when infoMC exists:

if (infoMC) infoMC.updateTextFunction(textO['Topic ' + currentTopicI + ' Slide ' + currentSlideI + ' Info']);
于 2012-07-18T02:02:45.060 に答える