animate spritesheet / gif player

Software: Away3D 4.x

mkfui, Jr. Member
Posted: 26 October 2016 06:55 AM   Total Posts: 31

can anyone show me an example code in complete for animate spritesheet ? i try offsetuv & updateuvdata, but i can’t get it.

refer to http://blog.peteshand.net/animated-gif-away3d-4-x-material/ we can apply gif player on plane, have anyone try it, can demonstrate it for me ? i need it urgently

   

mkfui, Jr. Member
Posted: 26 October 2016 07:08 AM   Total Posts: 31   [ # 1 ]

i meant spritesheet which was controllable, can use gotoandstop, total frame, current frame, anyone ?

   

mkfui, Jr. Member
Posted: 26 October 2016 08:41 AM   Total Posts: 31   [ # 2 ]

can NativeVideoTexture make use of gotoandplay function ?

   

Avatar
Fabrice Closier, Administrator
Posted: 26 October 2016 09:10 AM   Total Posts: 1265   [ # 3 ]

http://away3d.com/tutorials/Using_sprite_sheets_in_your_project

   

mkfui, Jr. Member
Posted: 01 November 2016 05:42 AM   Total Posts: 31   [ # 4 ]

sir, can we stop on certain frame? i try both way but not success, is this spriteSheetAnimator in non stop nature, can sir demonstrate it for me ? 

var totfr:uint = spriteSheetAnimator.totalFrames;
var curfr:uint = spriteSheetAnimator.currentFrameNumber;

if (curfr===2) {

spriteSheetAnimator.gotoAndStop(2);
// spriteSheetAnimator.stop();
 
}

or goto certain frame by assigning of another animator :

if (curfr===2) {

spriteSheetAnimator.gotoAndPlay(3); // not success, sir
// mesh.animator = spriteSheetAnimator2; 

// spriteSheetAnimator2.play(“default”);
 
}

   

Avatar
Fabrice Closier, Administrator
Posted: 01 November 2016 10:48 AM   Total Posts: 1265   [ # 5 ]

look at the clock example, the hours, minutes have a stop.

   

mkfui, Jr. Member
Posted: 09 November 2016 07:53 AM   Total Posts: 31   [ # 6 ]

sir, that example not work, i modify the awd part to :

AssetLibrary.enableParser(AWD2Parser);
AssetLibrary.addEventListener(AssetEvent.ASSET_COMPLETE, onMeshReady);
AssetLibrary.addEventListener(LoaderEvent.RESOURCE_COMPLETE, onLoadedComplete);
AssetLibrary.addEventListener(LoaderEvent.LOAD_ERROR, onLoadedError);
AssetLibrary.loadData(obje, new AssetLoaderContext(false));
AssetLibrary.loadData(new obje() );

but for swf part, error :

SecurityError: Error #3226: Cannot import a SWF file when LoaderContext.allowCodeImport is false.
at flash.display::Loader/_loadBytes()
at flash.display::Loader/loadBytes()
at Intermediate_SpriteSheetAnimation2/setUpSpriteSheets()
at Intermediate_SpriteSheetAnimation2()

   

Avatar
Fabrice Closier, Administrator
Posted: 09 November 2016 10:22 AM   Total Posts: 1265   [ # 7 ]

You try to use an interactive swf (with code) vs simple timelines.

   

mkfui, Jr. Member
Posted: 18 February 2017 05:19 AM   Total Posts: 31   [ # 8 ]

sir, i can’t get it, can sir demonstrate ?

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X