ruffle icon indicating copy to clipboard operation
ruffle copied to clipboard

Max & Ruby: Speedy Max [Error dispatching event EventObject]

Open Stefannag opened this issue 1 year ago • 2 comments

Describe the bug

When pressing the "Play" button, there are 2 errors / bugs

ERROR core/src/avm2/events.rs:428 Error dispatching event EventObject(EventObject { type: "added", class: flash.events::Event, ptr: 0x2eb4100 }) to handler FunctionObject(FunctionObject { ptr: 0x1bfb910, name: Ok("fl.text::TLFTextField/repaint()") }) : TypeError: Error #1009: Cannot access a property or method of a null object reference. (accessing field: computedFormat)

ERROR core/src/avm2/events.rs:428 Error dispatching event EventObject(EventObject { type: "click", class: flash.events::MouseEvent, ptr: 0x2eb66c8 }) to handler FunctionObject(FunctionObject { ptr: 0x6cfef90, name: Ok("com.corus.speedyMax.screens::Landing/playClick()") }) : ReferenceError: Error #1069: Property getAtomIndexAtCharIndex not found on flash.text.engine.TextLine and there is no default value.

Expected behavior

When pressing the "Play" the game should start.

Content Location

Flash | Ruffle

Affected platform

Self-hosted version

Operating system

Windows 11

Browser

Google Chrome Version 120.0.6099.200 (Official Build) (64-bit)

Additional information

No response

Stefannag avatar Jan 19 '24 09:01 Stefannag

Full error with stack trace:

ERROR core/src/avm2/events.rs:428 Error dispatching event EventObject(EventObject { type: "click", class: flash.events::MouseEvent, ptr: 0xca87668 }) to handler FunctionObject(FunctionObject { ptr: 0xcb8c740, name: Ok("com.corus.speedyMax.screens::Landing/playClick()") }) : ReferenceError: Error #1069: Property getAtomIndexAtCharIndex not found on flash.text.engine.TextLine and there is no default value.
	at flashx.textLayout.compose::TextFlowLine/http://ns.adobe.com/textLayout/internal/2008::computePointSelectionRectangle()
	at flashx.textLayout.compose::TextFlowLine/http://ns.adobe.com/textLayout/internal/2008::selectionWillIntersectScrollRect()
	at flashx.textLayout.container::ContainerController/scrollToRange()
	at flashx.textLayout.edit::EditManager/finalizeDo()
	at flashx.textLayout.edit::EditManager/endCompositeOperation()
	at fl.text::TLFTextField/replaceText()
	at fl.text::TLFTextField/set text()
	at hoolib.utils::Copy/formatField()
	at com.corus.speedyMax.game.overlay::TutorialTrackStart/start()
	at com.corus.speedyMax.game::TutorialLevel/next()
	at com.corus.speedyMax.game::TutorialGame/newLevel()
	at com.corus.speedyMax.game::TutorialGame/newGame()
	at com.corus.speedyMax.screens::Tutorial()
	at com.corus.speedyMax.screens::Landing/playClick()

n0samu avatar Jan 19 '24 09:01 n0samu

after #14883 this is the error

ERROR ruffle_core::avm2::events: Error dispatching event EventObject(EventObject { type: "click", class: flash.events::MouseEvent, ptr: 0x29cf41c5520 }) to handler FunctionObject(FunctionObject { ptr: 0x29cf3ec25c0, name: Ok("com.corus.speedyMax.screens::Landing/playClick()") }) : ReferenceError: Error #1069: Property getFontMetrics not found on flash.text.engine.ElementFormat and there is no default value.
        at flashx.textLayout.elements::FlowLeafElement/getComputedFontMetrics()
        at flashx.textLayout.compose::TextFlowLine/makeSelectionBlocks()
        at flashx.textLayout.compose::TextFlowLine/http://ns.adobe.com/textLayout/internal/2008::computePointSelectionRectangle()
        at flashx.textLayout.compose::TextFlowLine/http://ns.adobe.com/textLayout/internal/2008::selectionWillIntersectScrollRect()
        at flashx.textLayout.container::ContainerController/scrollToRange()
        at flashx.textLayout.edit::EditManager/finalizeDo()
        at flashx.textLayout.edit::EditManager/endCompositeOperation()
        at fl.text::TLFTextField/replaceText()
        at fl.text::TLFTextField/set text()
        at hoolib.utils::Copy/formatField()
        at com.corus.speedyMax.game.overlay::TutorialTrackStart/start()
        at com.corus.speedyMax.game::TutorialLevel/next()
        at com.corus.speedyMax.game::TutorialGame/newLevel()
        at com.corus.speedyMax.game::TutorialGame/newGame()
        at com.corus.speedyMax.screens::Tutorial()
        at com.corus.speedyMax.screens::Landing/playClick()
        ```

cmdocmd avatar Jan 21 '24 22:01 cmdocmd

Since getFontMetrics has been implemented, the error is now

Error dispatching event EventObject { type: "click", class: flash.events::MouseEvent, ptr: 0x11a63e8 } to handler FunctionObject(FunctionObject { ptr: 0x4efaf90, name: "com.corus.speedyMax.screens::Landing/playClick()" }) : TypeError: Error #1009: Cannot access a property or method of a null object reference.
	at flashx.textLayout.compose::TextFlowLine/makeBlock()
	at flashx.textLayout.compose::TextFlowLine/makeSelectionBlocks()
	at flashx.textLayout.compose::TextFlowLine/http://ns.adobe.com/textLayout/internal/2008::computePointSelectionRectangle()
	at flashx.textLayout.compose::TextFlowLine/http://ns.adobe.com/textLayout/internal/2008::selectionWillIntersectScrollRect()
	at flashx.textLayout.container::ContainerController/scrollToRange()
	at flashx.textLayout.edit::EditManager/finalizeDo()
	at flashx.textLayout.edit::EditManager/endCompositeOperation()
	at fl.text::TLFTextField/replaceText()
	at fl.text::TLFTextField/set text()
	at hoolib.utils::Copy/formatField()
	at com.corus.speedyMax.game.overlay::TutorialTrackStart/start()
	at com.corus.speedyMax.game::TutorialLevel/next()
	at com.corus.speedyMax.game::TutorialGame/newLevel()
	at com.corus.speedyMax.game::TutorialGame/newGame()
	at com.corus.speedyMax.screens::Tutorial()
	at com.corus.speedyMax.screens::Landing/playClick()

Lord-McSweeney avatar Aug 06 '25 05:08 Lord-McSweeney

This needs TextLine.getAtomIndexAtCharIndex

SuchAFuriousDeath avatar Nov 30 '25 00:11 SuchAFuriousDeath