Git Product home page Git Product logo

Comments (7)

splhack avatar splhack commented on September 3, 2024

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.

gbelovari avatar gbelovari commented on September 3, 2024

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:

image

image

image

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.

splhack avatar splhack commented on September 3, 2024

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.

gbelovari avatar gbelovari commented on September 3, 2024

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.

splhack avatar splhack commented on September 3, 2024

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.

1GR3 avatar 1GR3 commented on September 3, 2024

THANK YOU!

from lwf.

gbelovari avatar gbelovari commented on September 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.