Skip to content

Commit dfd6434

Browse files
committed
avm2: Fix getChildByName to be case sensitive (close #19765)
1 parent 67f0460 commit dfd6434

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

core/src/avm2/globals/flash/display/display_object_container.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ pub fn get_child_at<'gc>(
156156
Ok(Value::Undefined)
157157
}
158158

159-
/// Implements `DisplayObjectContainer.getChildByName`
159+
/// Implements `DisplayObjectContainer.get_child_by_name`
160160
pub fn get_child_by_name<'gc>(
161161
activation: &mut Activation<'_, 'gc>,
162162
this: Value<'gc>,
@@ -169,7 +169,7 @@ pub fn get_child_by_name<'gc>(
169169
.and_then(|this| this.as_container())
170170
{
171171
let name = args.get_string(activation, 0)?;
172-
if let Some(child) = dobj.child_by_name(&name, false) {
172+
if let Some(child) = dobj.child_by_name(&name, true) {
173173
return Ok(child.object2());
174174
} else {
175175
return Ok(Value::Null);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//this.getChildByName("child_CLIP")
2+
null
3+
//this.addChild(newChild)
4+
//this.getChildByName("new_CHILD")
5+
null
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
num_frames = 1

0 commit comments

Comments
 (0)