Bug Issue: Build 9878 Attach image instance to Layer and exiting scene


Pages: 1

yoplalala

  • Subscriber - Stencyl Studio
  • *
May 27, 2018, 01:28:55 am
attach image instance AAAA to layer1 at x 20.
attach image intance AAAA to layer1 at x 40.
Reload Scene
doesn't work ( at least on Flash)
You will have this message
Code: [Select]
ArgumentError: Error #2025: Le DisplayObject indiqué doit être un enfant de l'appelant.
at flash.display::DisplayObjectContainer/removeChild()
at com.stencyl.models.scene::Layer/clear()[C:\Program Files (x86)\Stencyl35\plaf\haxe\lib\stencyl\1,00\com\stencyl\models\scene\Layer.hx:80]
at com.stencyl::Engine/cleanup()[C:\Program Files (x86)\Stencyl35\plaf\haxe\lib\stencyl\1,00\com\stencyl\Engine.hx:1703]
at com.stencyl::Engine/enterScene()[C:\Program Files (x86)\Stencyl35\plaf\haxe\lib\stencyl\1,00\com\stencyl\Engine.hx:1895]
at com.stencyl::Engine/onUpdate()[C:\Program Files (x86)\Stencyl35\plaf\haxe\lib\stencyl\1,00\com\stencyl\Engine.hx:2730]

It worked in Stencyl 3.4.

It has to do with https://github.com/Stencyl/stencyl-engine/blob/8ccab569b182d2c22f370f32aeaddcd0b9035cf2/com/stencyl/behavior/Script.hx#L2527
The instance is pushed multiple times.


Possible solution:
   - correct the code
       - enable to remove an image image instance even it wasn't attached anywhere before ( doesn't work on Flash, for some reason img.parent != null doesn't work)
       - create some new blocks.
There is now no way to know if an image  instance is already in used.
You could  have blocks
- is an image instance bound to a parent ?
- parent of an image instance ( returns Layer or Actor)
« Last Edit: May 27, 2018, 01:31:29 am by yoplalala »


rob1221

  • Master Stencyler
  • *
May 27, 2018, 01:44:05 pm
I'm not sure what the problem is.  Doesn't reloading the scene remove all images already?
  • Status changed from New to Need Info


yoplalala

  • Subscriber - Stencyl Studio
  • *
May 28, 2018, 12:18:29 pm
When you quit the scene
the layers cleans themselves

Code: [Select]
public function clear()
{
for(b in attachedImages)
{
removeChild(b);
}
Let's suppose we have twice the same image  image1.
The second time it tries to removeChild , it cannot. So Flash stops working


rob1221

  • Master Stencyler
  • *
May 28, 2018, 04:39:30 pm
Fixed in b9886.
  • Status changed from Need Info to Resolved
  • Issue Assigned from (none) to rob1221


Pages: 1

Details

  • Reported
    May 27, 2018, 01:28:55 am
  • Updated
    May 28, 2018, 04:39:30 pm

  • View Status
    Public
  • Type
    Bug
  • Status
    Resolved
  • Priority
    Normal
  • Version
    Stencyl 3.5, 3.5.0 beta 1
  • Fixed in
    (none)
  • Assigned to
    rob1221
  • Category
    (none)

Tags