A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Movieclip Problem (PLEASE HELP)

  1. #1
    Senior Member
    Join Date
    Apr 2001
    Posts
    126
    I have studied Dan Ludwig's tutorial located at : http://www.flashkit.com/tutorials/In...2/index.shtmlv

    I think it's the best continuous feedback scroll button tutorial out there, but I am having a problem with it. I want to put it on my timeline as a MOVIECLIP, but when I try converting it to a Movieclip the scroller mechanism no longer works when I do a Test Movie on it.

    Can anyone out there please help me out with some advice on how to get this .FLA file converted to a movieclip?

    The .FLA file I'm using is the same one that is available for free download at:
    http://www.flashkit.com/tutorials/In...2/index.shtmlv

    Here you will find a great tutorial, and the same .FLA file I'm trying to convert to a Movieclip. Before opening it I changed the file properties from READ ONLY to ARCHIVE. Once opened in Flash, I then selected all of the layers, copied the frames, went to INSERT > NEW SYMBOL (Movieclip) and pasted all the frames in the new movieclip which I named Scroller Movieclip. I then created a new scene and into this new scene 2 I dragged the Scroller Movieclip.

    Below you will find two sets of Debugger > List Variables > Output Codes. The first one (shown below) is from Scene 1 which has the Continuous Feedback Scroller in its original state. It works perfectly when I do a Test Scene, and this is the LIST VARIABLE code that is generated:

    Level #0:
    Variable _level0.$version = "WIN 5,0,30,0"
    Variable _level0.var_mc = [movieclip:_level0.button_list]
    Movie Clip: Target="_level0.scroll_shape.logic"
    Variable _level0.scroll_shape.logic.target = [movieclip:_level0.button_list]
    Variable _level0.scroll_shape.logic.bar_length = 216.25
    Variable _level0.scroll_shape.logic.top = 79.4
    Variable _level0.scroll_shape.logic.bottom = 296.15
    Variable _level0.scroll_shape.logic.clip_top = 628
    Variable _level0.scroll_shape.logic.clip_height = 851.15Level #0:
    Variable _level0.$version = "WIN 5,0,30,0"
    Variable _level0.var_mc = [movieclip:_level0.button_list]
    Movie Clip: Target="_level0.scroll_shape.logic"
    Variable _level0.scroll_shape.logic.target = [movieclip:_level0.button_list]
    Variable _level0.scroll_shape.logic.bar_length = 216.25
    Variable _level0.scroll_shape.logic.top = 79.4
    Variable _level0.scroll_shape.logic.bottom = 296.15
    Variable _level0.scroll_shape.logic.clip_top = 628
    Variable _level0.scroll_shape.logic.clip_height = 851.15


    The DEBUGGER > LIST VARIABLE code shown below is generated from doing a Test Scene on Scene 2 which contains the moviclip named Scroller Movieclip. In this case the scrolling mechanism does not work like it does in Scene 1:

    Level #0:
    Variable _level0.$version = "WIN 5,0,30,0"
    Movie Clip: Target="_level0.instance1"
    Variable _level0.instance1.var_mc = undefined
    Movie Clip: Target="_level0.instance1.scroll_shape.logic"
    Variable _level0.instance1.scroll_shape.logic.target = undefined
    Variable _level0.instance1.scroll_shape.logic.bar_length = 216.25
    Variable _level0.instance1.scroll_shape.logic.top = -120.6
    Variable _level0.instance1.scroll_shape.logic.bottom = 96.15
    Variable _level0.instance1.scroll_shape.logic.clip_top = undefined
    Variable _level0.instance1.scroll_shape.logic.clip_height = -291.75

    Looking at the above code I notice the word "undefined" comes up three times. Can anyone tell me how I am suppose to fix this? Moreover, I was able to get a "HINT" of what the problem could be from the author of this tutorial named Dan Ludwig. In his e-mail he says the problem is because the original tutorial used _root instead of _parent (this is Greek to me).

    If anyone out there can help me in figuring out how I can change the required elements to "_parent" I will really appreciate it a lot. I need this scroller scene converted to a Movieclip so that I can put it on my timeline. If anyone can download this file and try converting it to a movieclip and tell me what is the best way to make this thing work as a movieclip I would be very gratefule. Many thanks in advance for any help.

    Regards,
    Binar

  2. #2
    Senior Member
    Join Date
    Mar 2000
    Location
    London
    Posts
    961
    I've had a look at the FLA and changes you need to make are:

    scroll_logic
    Change '_root' to '_parent._parent'. This means that instead of start to look for scrool_shape in the main timeline of your movie, it looks 2 movie clips up from where scroll_logic is located. This way you can put the scroller inside movieclips and it will still work.

    eval(target)._y = clip_top-(((_parent._parent.scroll_shape._y-top)/bar_length)*clip_height);

  3. #3
    Senior Member
    Join Date
    Apr 2001
    Posts
    126

    A little bit more help please

    Little Ben,
    Thank you very much for taking the time to help me out. This problem has had me stumped for the last two weeks, and it's brought my website development to a total halt.

    I am following your instructions to the letter with no success. I'm wondering if you would be kind enough to look at my step by step overview below an tell me what I am doing wrong:

    1. I opened the Flash5_mc_scrolling.fla file and unlocked all of the layers, including the logic layer inside of the scroll_shape_obj movieclip.

    2. I opened the LIBRARY and double clicked on the "Scroll_logic" movieclip, and then clicked on Frame 2. When I do this, the Frame Actions dialog box shows this code: eval(target)._y = clip_top-(((_root.scroll_shape._y-top)/bar_length)*clip_height);

    3. I then typed over the "_root" and changed it to the following: eval(target)._y = clip_top-(((_parent._parent.scroll_shape._y-top)/bar_length)*clip_height);

    4. I then went back to the main timeline in Scene 1 and copied the frames for all eight layers.

    5. Then I created a new Movie Clip by going to Insert > New Symbol. In the Symbol Properties dialog box that pops up I checked off Movie Clip Behavior and named it Test Run.

    6. I then went to Frame 1 inside of Test Run and did a Paste Frames. Eight layers appear. The paste ends up using two columns of frames, so I did a little tweaking so that a only one column is used.

    7. I then go back to the main timeline on Scene 1. In my Library a new Movie Clip shows up named Test Run.

    8. I created a new Scene named Scene 2. In Scene 2 I drag from the Library an instance of the Test Run movie clip.

    9. I then do a Test Scene and what happens is that the Target Movie Clip does not move when I drag the scroll button or click on the arrows.

    Litte Ben, I'm curious to know if you got a chance to do a Test Scene on your Movie Clip with your modified code, and did it work? If you got it to work as a movie clip I'm wonder if it would be too much trouble for you to e-mail me a working copy of your movie clip to Binar@bellsouth.net

    This will help me out a lot. If you can't do this, please look over my steps and tell me what I could possibly be doing wrong. I'm going nuts here because I'm a graphic designer, and not a programmer / mathematician. Thank you very much in advance.

    Regards,
    Binar






  4. #4
    Senior Member
    Join Date
    Mar 2000
    Location
    London
    Posts
    961
    Sorry, fo some reason half my post seems to be missing...

    In "scroll_logic", "cfb_logic_down", "cfb_logic_up":

    Change all instances of '_root' to '_parent._parent'

    In frame one of your scene in the actions frame:

    Change '_root.button_list' to 'button_list'


    You should then be able to copy all your frames into a movie clip...

  5. #5
    Senior Member
    Join Date
    Apr 2001
    Posts
    126

    Thank You A Million Times

    Little Ben!
    Thanks for helping me lick this problem. This thing finally works as a movieclip. Now I can put it anywhere on my main timeline and finally get back to work on my website. Obviously there is still a lot I need to learn about Flash. I'm definitely going to have to pick up a good book on Actionscripting. Once again thanks a lot.

    Regards,
    Binar

  6. #6
    Senior Member
    Join Date
    Apr 2001
    Posts
    126

    Oversight on one detail

    Little Ben,
    I'm sorry for being a pain, and I really do hope I haven't got on your nerves yet, but there is something I overlooked and that wasn't included in my last posting to you. The file as a movieclip works great except for the upper and lower scroll buttons. Making the changes to the code you instructed seems to have disabled the ability to scroll the Target MC using either the Upper or Lower scroll buttons. But curiously enough, the same Target MC can still be scrolled using the scrolling slider button. So one is able to scroll the Target MC using the slider button, but not by pressing either on the Upper or Lower scroll buttons as you would be able to in let's say any standard Windows scroller bar. The only functionality these two buttons seem to still possess is the one where if you double click on the Upper scroll button it jumps the Target MC to the Top or if you double click on the Lower scroll button it jumps the Target MC to the bottom. Below is the Debugger > List Variable output test I did and I can't find any undefined variables. I also reread pages 6 through 12 of the tutorial but this doesn't address my problem.

    Level #0:
    Variable _level0.$version = "WIN 5,0,30,0"
    Variable _level0.var_mc = [movieclip:_level0.button_list]
    Movie Clip: Target="_level0.scroll_shape.logic"
    Variable _level0.scroll_shape.logic.target = [movieclip:_level0.button_list]
    Variable _level0.scroll_shape.logic.bar_length = 216.25
    Variable _level0.scroll_shape.logic.top = 79.4
    Variable _level0.scroll_shape.logic.bottom = 296.15
    Variable _level0.scroll_shape.logic.clip_top = 628
    Variable _level0.scroll_shape.logic.clip_height = 851.15

    I would really, really appreciate it if you can take a look at the this file one last time and help me figure out why these Upper and Lower Scroll buttons won't work right.

    Thank you very much in advance.

    Regards,
    Binar

  7. #7
    Senior Member
    Join Date
    Mar 2000
    Location
    London
    Posts
    961
    OK, got it this time...



    In "scroll_logic":

    Change all instances of '_root' to '_parent._parent'

    In "cfb_logic_down", "cfb_logic_up":

    Change all instances of '_root' to '_parent._parent'

    In frame one of your scene in the actions frame:

    Change '_root.button_list' to 'button_list'



    Should work now...

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