A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Error #1006 Value in not a function... SOLVED BUT it's the right way?

  1. #1
    Junior Member
    Join Date
    Jul 2011
    Posts
    14

    Question Error #1006 Value in not a function... SOLVED BUT it's the right way?

    Hi i've this simpel code

    var ter: terms=new terms()
    addChild(ter)
    ter.name="termini"


    (getChildByName("termini") as MovieClip).scroller.barra.addEventListener(MouseEv ent.MOUSE_DOWN, scrollatermini)
    but when i launch it flash give me error 1006: value is not a function..

    I've solved converting all in MovieClip


    MovieClip( (getChildByName("termini") as MovieClip).scroller.barra).addEventListener(MouseE vent.MOUSE_DOWN, scrollatermini)
    I ask to you that are expert than of me: is it the right way to do this?

  2. #2
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    If scroller is a property of the terms class then no casting is required.
    Code:
    ter.scroller.barra.addEventListener(MouseEvent.MOUSE_DOWN, scrollatermini);

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