Comments (7)
there are several way to get there. For example, LWF instance operator[] returns Movie instance by instance name.
Movie movie = lwfObject.lwf["child_Sym"];
if (movie)
movie.GotoLabel("start");
from lwf.
Hi splhack,
I tryed that way (using C#):
lwf["winScreen"].Stop();
and I get NullReferenceExeption in Unity, probably can't get to that instance name, but I can't figure why. I'm questioning now the way I export to swf, but I think I followed all the rules.
in Flash I set it up like this:
I'm getting a bit desperate here, I know it should be simple but I must be doing something terrible wrong...
thank you for your help!
from lwf.
LWF operator[] or SearchMovieInstance uses instance name not symbol name. Could you try it?
http://digitalartanddesign.org/assets/flash/images/instance-name.png
from lwf.
Hi splhack,
I tryed to do a little test with those instance names and whatnot (fla file in link below):
https://drive.google.com/file/d/0BztBi3BqxzdsVnYzWnBtbGRXRWs/edit?usp=sharing
Main symbol is named "outer" - has additional translation animation added
inner symbols are : "inner" - has it's own rotation animation
"playMC" has it's own rotation animation
So inside my test_lwf : LWFObject class, I do it like this (feel free to correct me if I do anything wrong):
Movie attached_movie;
void Start()
{
string dir = string.Format("{0}.swf/", "test");
string path = dir + "test";
Load(path:path, texturePrefix:dir);
attached_movie = lwf.rootMovie.AttachMovie("outer","test");
attached_movie.Stop();
}
and what that makes is that "outer" animations stop but not animations from "inner" or "playMC".
And when I try accessing one of those objects via instance name ("playMC" has instance name added):
lwf["playMC"].Stop();
or
attached_movie["playMC"].Stop();
I get NullReferenceInstance error and can't access "playMC" in any way known to me...
I hope this makes any sense and you can help me with this, this is probably a second week I'm dealing with this without any progress :)
thank you for your swift answers and great support!
from lwf.
Because "inner" or "playMC" movie instance might not exist at that time, thus operator[] and SearchMovieInstance returns null. So you have to check null for the methods before calling Stop() method. Usually you can get the instance via operator[] and SearchMovieInstance in the next frame. It is not the exactly same behavior as Flash Player, but this behavior is for performance in LWF.
Or you can use LWF.AddMovieEventHandler method for catching the "inner" or "playMC" instance.
lwf.AddMovieEventHandler("inner", postLoad:(movie) => {
movie.stop();
});
from lwf.
THANK YOU!
from lwf.
that worked!
now I get the whole picture and feel a bit stupid :)
oh wise and great splhack, thank you for your help and great support!
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.