Comments (8)
How about this?
lwfObject.AddMovieEventHandler(/* movie instance name */ "foo", enterFrame:(movie) => {
if (movie.currentFrame == movie.totalFrames || !movie.playing) {
UnityEngine.Debug.Log(movie.GetFullName() + ": done");
}
});
from lwf.
thax,but in my case have err...can you tell me more detail.
from lwf.
void Start()
{
string dir = string.Format("{0}/", file_name);
string path = dir + file_name;
Load(path:path, texturePrefix:dir);
attached_movie = lwf.rootMovie.AttachMovie("test","test");
AddMovieEventHandler("test", enterFrame:(movie) => {
UnityEngine.Debug.Log("test");
});
}
IT's not err but Console display nothing...AddMovieEventHandler not work....i think..
from lwf.
Could you use the latest version of lwf (222ad0e)? Older versions might have such kind of bugs.
from lwf.
i think i used lastest version lwf for unity....
from lwf.
I've updated one of the lwf demo projects to demonstrate splhack's solution.
Please take a look following example.
Source
Build
- Web Player : http://gree.github.io/lwf-demo/unity/attach_movies_from_library_sprite/attach_movies_from_library_sprite.html
- The "Attach movie from libray sprite" button add new symbol to stage with adding "enterFrame" callback that called every frame.
- The added symbol will be removed when the animation reached to end with splhack's solution.
LWF.Movie attached_movie =
lwf.rootMovie.AttachMovie(
linkage_name, // Symbol's linkage name in library
instance_name, // Attached movie name.
enterFrame: enterFrameCallback // Callback that called every frame.
);
void enterFrameCallback( LWF.Movie movie )
{
if (movie.currentFrame == movie.totalFrames
|| !movie.playing) {
message += movie.GetFullName() + " is done \n";
lwf.rootMovie.DetachMovie( movie );
}
}
from lwf.
thank you so much.it works!^^
from lwf.
I'm happy to hear that.
Closed.
from lwf.
Related Issues (20)
- OnEnterFrame not working on low FPS flashes? HOT 2
- Non-movable buttons HOT 5
- Text Filters in Unity HOT 1
- Getting LWF.Bounds of a LWF.Movie immediately HOT 1
- Updating the flash with a delta time of 0 still calls OnEnterFrame
- Disabled buttons still blocking mouse events
- TextProperty in Unity
- Changing the ColorTransform of a LWF.Movie HOT 1
- Blending modes
- SetText() not always rendering new value HOT 2
- fscommand ignored unless frame entered "naturally" HOT 1
- I got a data file(.lwf) used this tool(swf2lwf.rb).But I cannot use in the unity.
- Warnings
- No longer rendering timeline HOT 3
- Text fields are not respecting the alpha of the MovieClip that contains it
- flash-in-unity.net
- can you support spritekit?
- Shapes Support
- Locate error cause easily when converting swf files
- Bad link HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lwf.