dcsimg
A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Help with Tell Target and Variable Paths.

  1. #1
    Junior Member
    Join Date
    Sep 2000
    Posts
    28
    I am new to flash, and want to do some basic action script.
    so far, as long as I keep all the variables with in the Main movie, and in one movie clip, all has been well...

    the problem has occured here... I had a working actionscript text animator built in my MAIN, but decided I wanted to move it into a movie clip instead... it ceased to work, I changed a few things, and it got a heart beat but still no life.

    I have my MAIN Movie, and it has a menu feature, so I created a Movie Clip for each feature of the menu... They all work great except for one.

    The problem is when I use basic action script to animate the text in this one menu feature...

    The MC is called Info and it's instance is also Info.

    Inside of it, I have a MC called Text (Instance is Text)
    Obviously I want TEXT to be my textwriter script.

    Inside TEXT is a MC called Ani(instance Ani) and inside
    Ani is a MC called Letter (instance Letter)

    So the basic hierarchy is...
    Main "parent of"
    Child Info "parent of"
    Child Text "parent of"
    Child Ani

    Here is the code which uses each MC

    In TEXT
    ** NOTE : was ("/ani",... I changed to...

    Set Property ("ani", Visibility) = False

    **The reason... ani is no longer the top object of the MAIN, but is now the child of the MC called TEXT.

    ** NOTE : was ("/ani",... I changed to...
    Duplicate Movie Clip ("ani", "ani"&i, i)

    *** Same reason as above.

    This stayed the same since it's using "ani"&i which was declared above... so I didn't touch.

    Set Property ("ani"&i, X Position) =
    startx+charinline*kerning
    Set Property ("ani"&i, Y Position) =
    starty+linenumber*linespace

    *** This is where I think I screwed it up...
    *** Note was /ani and /letters:letters

    Set Variable: "ani"&i&"letters:letters" = Substring
    ( text, i, 1 )

    *** I changed because again ani is no longer in the MAIN but in a movie clip as a child, and letters is a child of ani... but I don't know if I should add or change anything for letters because I am grey on this area...

    In ANI

    **** NOTE I changed all "/" to ".." in this case

    Set Variable: "..:lettercount" = ..:lettercount+1
    If (..:lettercount = ..:length)
    Begin Tell Target ("..")

    ** Reason because these variables are not in the MAIN but in the parent MC "text" which "ani" is a child of. So ".."
    should send to parent MC "text" right?

    The result? At least I get the first letter now but dissapears and nothing else happens... I am going to problem solve through this all night... I just know it.

    Any insights?

    Cheers,
    Oblivion



  2. #2
    Senior Member
    Join Date
    Aug 2000
    Posts
    148
    firstly '../' will send you to a parent movie clip (just like in html if you want to go back a directory, '/' will take you to the main timeline.

    When I work with variables I always set them in the main timeline ie:
    /:varname = varproperty

    This way whenever you need to access a variable you just need to put a '/:' in front of it and you know it is looking in the right place

    Hope this helps a bit

  3. #3
    Junior Member
    Join Date
    Sep 2000
    Posts
    28
    Hey DaveT,
    Thanks for the reply. Yes, it does help a bit... I managed to get it to work, it was tough, and it still has a few minor glitches... very minor. I think I can handle it now. I have learned a lot today

    >Hope this helps a bit

    Yes, it makes more sense to do it that way. Thanks for the tip!

    Cheers,
    Oblivion

  4. #4
    Junior Member
    Join Date
    Sep 2000
    Posts
    3

    Almost the same problem

    Those actionscript font animations are troubling me, too!
    I want to build up a navigation-menue with the topicnames appearing with the use of a fontanimation.

    so the prob is that for any instance, ie, any topic there have the be the same variables, but they have only to work in the instance they belong to. Also many instances hav to co-exist at the same time, so putting the variables into the mainmovie by attaching /: won't work.

    by now i managed to let the animation appear...but unfortunately the characters appeare all at the same spot, ie. the kerning doesn't take effec.
    The second is that loading the new character fails, so that every character stays a 'w'...

    and by the way i think that my source flash-file differs from yours, for i have no linejumping e.g.

    I believe it would be best if one of you gave me a functional actionscript so i could study and adapt it perhaps...

    uc, the mainproblem is again the correct adressing of the different variables and duplicated movies.

    so please...HELP!

  5. #5
    Junior Member
    Join Date
    Sep 2000
    Posts
    28

    Re: Almost the same problem

    Hey BullShaft,
    Yeah, it's totally pissin' me off too. Once I place actionscript into a movie clip... the more I try to advance it into a series of movie-clips, the harder it is to get the damn thing to work properly.

    So far, I have had success with advancing it forward into one movie clip... The success was not perfect, there was still problems with the alignment at this point...

    Moved it further still, and other aspects of the code ceased to function. And I have painstakenly plotted out each PATH for each variable and tell target to be as acurate as one can be, and it still has these problems... as to why? Your guess is as good as mine, but I like the challenge... it's my goal to make an actionscript Movie Clip that can be as deep into a hierarchy as one would like. Can it be done? Opinions anyone?

    Maybe there is other solutions to this kind of problem...

  6. #6
    Junior Member
    Join Date
    Sep 2000
    Posts
    3

    I did it

    my first fontanimation's working. I managed to include a linejump.
    After a certain number of charactars in a line the programms looking for a "space" between 2 words.
    after that it jumps to the next line and is going on with writing . That prevents words from being separated at the end of a line.

    Know the only prob is...the only BIIIIIIG prob...that the variables still are adressed in the mainmovie...

    and to adress every variable in about 10 MCs...well, that's heck a lot of work to do...
    I could adress every MC's variables, but then the script of every mc has to be changed corresponding to its instance name...and i don't like having so much work to do. So I Just leave it and be happy that it's working so far

    CU, BullShaft

  7. #7
    Junior Member
    Join Date
    Sep 2000
    Posts
    28

    Re: I did it

    Yeah, I have it kind of working, still need to iron it out a little. Like you, at least it's working. However, as I learn a little more about actionscripting, i am sure good planning and organization will pay of in the end.

    cheers,
    Oblivion

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center