Highlighted

Bring object to front dynamically doesn't work anymore

New Here ,
Jun 04, 2020

Copy link to clipboard

Copied

Hello, I followed other threads to bring objects to the front dynamically through all the following scripts in HTML5.

 

// ES5 setChildIndex

this.bringToFront = function(e) {

    e.currentTarget.parent.setChildIndex(e.currentTarget, e.currentTarget.parent.numChildren - 1);

}

 

// ES6 setChildIndex

this.bringToFront = (e) => {

    e.currentTarget.parent.setChildIndex(e.currentTarget, e.currentTarget.parent.numChildren - 1);

}

 

// ES5 addChild

this.bringToFront = function(e) {

    e.currentTarget.parent.addChild(e.currentTarget);

}

 

// ES6 addChild

this.bringToFront = (e) => {

    e.currentTarget.parent.addChild(e.currentTarget);

}

 

None of these methods work any more. Maybe there was an update. Could anyone tell an alternate way?

Adobe Community Professional
Correct answer by ClayUUID | Adobe Community Professional

When Animate updated to CreateJS 1.0.0, they made a change that caused single-frame movieclips to loop continuously instead of just playing once and stopping. This causes the movieclip's display list to continuously reset.

 

So just stop() your container clips.

Topics

ActionScript, Code, How to

Views

290

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Bring object to front dynamically doesn't work anymore

New Here ,
Jun 04, 2020

Copy link to clipboard

Copied

Hello, I followed other threads to bring objects to the front dynamically through all the following scripts in HTML5.

 

// ES5 setChildIndex

this.bringToFront = function(e) {

    e.currentTarget.parent.setChildIndex(e.currentTarget, e.currentTarget.parent.numChildren - 1);

}

 

// ES6 setChildIndex

this.bringToFront = (e) => {

    e.currentTarget.parent.setChildIndex(e.currentTarget, e.currentTarget.parent.numChildren - 1);

}

 

// ES5 addChild

this.bringToFront = function(e) {

    e.currentTarget.parent.addChild(e.currentTarget);

}

 

// ES6 addChild

this.bringToFront = (e) => {

    e.currentTarget.parent.addChild(e.currentTarget);

}

 

None of these methods work any more. Maybe there was an update. Could anyone tell an alternate way?

Adobe Community Professional
Correct answer by ClayUUID | Adobe Community Professional

When Animate updated to CreateJS 1.0.0, they made a change that caused single-frame movieclips to loop continuously instead of just playing once and stopping. This causes the movieclip's display list to continuously reset.

 

So just stop() your container clips.

Topics

ActionScript, Code, How to

Views

291

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Community Professional ,
Jun 04, 2020

Copy link to clipboard

Copied

When Animate updated to CreateJS 1.0.0, they made a change that caused single-frame movieclips to loop continuously instead of just playing once and stopping. This causes the movieclip's display list to continuously reset.

 

So just stop() your container clips.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
New Here ,
Jun 04, 2020

Copy link to clipboard

Copied

Thanks a lot 😄

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...