dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Site navigation approach and best practices

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

    Site navigation approach and best practices

    Hi there,
    I'm having some troubles making traditional site navigation in actionscript 3
    the first problem was to export a movieclip for actionscript.

    I've got a movieclip which in first frame i call a custom class that extends Sprite Class and has some references to the stage (using ADDED_TO_STAGE event)

    It´s working fine, but if I try to export this movieclip for actionscript giving the class name Player and Base Class MovieClip or Sprite to it I got this error

    TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::MovieClip@2bfcc8f9 to Player.

    I know that is probably the worst way to make it, but i'm a little lost on how to do it...

    In AS2 I could give the movieclips indetifiers and then put them on the Stage using attachMovie() and removing using removeMovieClip(), now Adobe says that you can give a Class name and call the movieclip using the code example

    var mc:Player = new Player();

    add them using addChild() and remove using removeChild();

    but which would be the best way to make somthing like this? or, how do you make regular site navigation using AS3?

    thanks
    Chan

  2. #2
    Multitouch Aficionado
    Join Date
    Mar 2006
    Posts
    275
    Do you extend MovieClip in your Class file?

  3. #3
    Junior Member
    Join Date
    Jul 2007
    Posts
    14
    i tried both, extending Sprite and MovieClip Class...the error remains

    if I check the 'export in first frame" there´s no error, but this will "kill" my preloader...

    is there an option to solve this?

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