Stencyl 3.4.0 is now out. Get it now!

(Stencyl 3.5 / OpenFL 6.x) Extension Modifications

mdotedot

  • *
  • Posts: 1226
Some of my (multiuser) extensions suffered from problems when using in Stencyl 3.5 (Beta)

Flash works without a problem with these URLLoader/Loader issues.

For the other publications you need to cast them:

* Error: e.target.data : IEventDisplatcher has no field data
Change code     e.target.data    to   cast(e.target, URLLoader).data
* Error: openfl.events.IEventDispatcher has no field content
Change code
e.currentTarget.content.bitmapData into:  cast(cast(e.currentTarget,Loader).content,openfl.display.Bitmap).bitmapdata;

See also: https://github.com/openfl/openfl/issues/1321

This will still work when the extension is used in Stencyl 3.4

Also some references to openfl.utils need their lime.utils counter-parts:
Change :    import openfl.utils.UInt8Array
 into:            import lime.utils.UInt8Array

This topic might be updated later when I encounter more issues.

Best regards from
M.E.
Hanging out in the Chat:  http://www.stencyl.com/chat/

yoplalala

  • *
  • Posts: 1376
You can have some extensions that work on both version of Stencyl , you can use this trick
#if (openfl >= "4.0.0")  // Thats Stencyl 3.5
import com.stencyl.Config as S;
#else
import scripts.MyAssets as S;
#end

mdotedot

  • *
  • Posts: 1226
Thanks Yoplalala,

Good to know! My issues at the moment work with the cast for both targets! But it might come in handy for other issues!
Best regards from
M.E.
Hanging out in the Chat:  http://www.stencyl.com/chat/

yoplalala

  • *
  • Posts: 1376
You'rel lucky ;)

From Openfl 4 ( Stencyl 3.5 is now at OpenFl 6)

We have removed deprecated references to openfl.gl.* and openfl.utils.* typed arrays, JNI and GL classes. You should use lime.graphics.opengl.* or lime.utils.* when using these types in your projects.


openfl.utils.JNI  => lime.system.JNI
 openfl.utils.SystemPath.applicationStorageDirectory =>  lime.system.System.applicationStorageDirectory

I'am also noticing that
Code: [Select]
var shadow:openfl.filters.DropShadowFilter  = new openfl.filters.DropShadowFilter();
__actor.filters = [shadow];

in android doesn't work anymore. The app crashes.

PS: Just noticed , maybe you were talking only about your extensions ....  But I think it could be a great thread to put find what needs to be modified for Openfl 3.6 ;)

« Last Edit: September 11, 2017, 01:08:35 pm by yoplalala »