A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: a question on include and one on prototype.

  1. #1
    Senior Member
    Join Date
    Jun 2001
    Posts
    289

    a question on include and one on prototype.

    I have a movie with frames as follows:

    1: loads vars.

    2: check vars loaded, if not, goes to and plays 1. Also checks number of times it has done this, and redirects to an error page if too many attempts.

    3: initialises things, basic housekeeping, including the line:
    #include "ascript.as";
    which I was hoping would save me modifying every movie using this action process if I changed the process.

    4: the beginning of a loop. Once we reach here, we never go back to any previous frame.

    But the #include does not appear to work. The movie gets to frame four without doing the include stuff, or any stuff following the include. Replacing the include with the actual script works.

    Is include supported by 3.5?
    Does the flash player include and then execute, or include and move on, ie, should I only include functions that I refer to after the event?

    Also ...
    What on earth does prototype do? I saw this mentioned in a flash tutorial and can't figure out what they were talking about.

    Thanks.

  2. #2
    Senior Member
    Join Date
    Jul 2000
    Posts
    5,087
    they are not supported by 3.5

    When inside the AS editor hit the ? and it will show you the supported syntax.

  3. #3
    Senior Member
    Join Date
    Jun 2001
    Posts
    289
    Ok. Thanks, Johnie.

  4. #4
    Senior Member
    Join Date
    Sep 2001
    Location
    Australia
    Posts
    379
    As Johnie said, they are not supported in KM at this time.

    For your information, "#include" imports a script text file when the swf is exported - it does not import the file at runtime.

    Prototype is supported in the new 3.6 Beta - soon to be released.

    Prototype is a property of a constructor function and is used in Object Oriented ActionScript for inheriting properties and methods of objects.

    You can make a prototype function into a normal function and call it that way without taking advantage of OO stuff - depending on what it does...

    Look here for a great tutorial on OO ActionScript;
    http://www.debreuil.com/docs/ch01_Intro.htm

    Hilary

    --

  5. #5
    Senior Member
    Join Date
    Jun 2001
    Posts
    289
    Heya! Much appreciated.

    I used the #include in the beta, and love the fact that I can. This is going to improve production and reduce errors no end.

    (should have realised it would not be a flash player include - too much old interpretive ASP).

    I am now wading through the constructor/prototype thing in the link you provided.

    lol.

  6. #6
    Senior Member
    Join Date
    Sep 2001
    Location
    Australia
    Posts
    379
    Cool,
    I didn't even realise that include was working in the beta!

    It has been a case of working through the new objects, properties and and methods and seeing what is working and what isn't.

    I am working through the XML Object at the moment and finding out what does and doesn't work. I have got it working ok by traversing through a known XML schema, but you can't do a "blind" run through an XML document at the moment because "for...in" is not implemented. There are also some KM specific syntax things that work in Flash but not in KM.

    AnyHow... here is an image browser I put together while testing the new MX functionality in KM.
    http://www.bridel.org/koolmoves/demo...slideshow.html
    It imports an XML document for all image details, uses dynamic jpg import, the new movieclip buttons and some other bits. Just have to add some dynamic masks and convert it to use the new setInterval for automatic image display.

    I have also put together an XML feed from the Macromedia designer and developer page.
    http://www.bridel.org/koolmoves/demo/mx/xml/desdev.html

    There is so much new Actionscript functionality in the Beta, I don't know which way to turn

    Hilary

    --

  7. #7
    Senior Member
    Join Date
    Sep 2001
    Location
    Australia
    Posts
    379
    OwenAus,
    I can't get #include to work...

    Hilary

    --

  8. #8
    Senior Member
    Join Date
    Jun 2001
    Posts
    289
    I can't either, anymore.

    I am passing stuff back and forward between server/db and swf, and run a generic "handler.asp" to deal with everything, so I have to create the swf and run/test via IIS (as ASP creates the data the swf needs).

    I think when I switched to the includes, I was getting cached results (swf, not data) and made an assumption ...

    .. which was blown when I tried a new movie using the includes and got zero result.

    My bad. Sorry to mislead.

    Neat stuff in those links, BTW. And yes, a smorgasboard of choices.

    == definately caching. I was using seconds to make urls unique -
    ?rn=xx
    - but they duplicate, so I can get old swf on one click, new swf on next. Weird.

    Think I willl use full date and time - that has to be unique!
    Last edited by OwenAus; 11-20-2002 at 09:25 AM.

  9. #9
    Senior Member
    Join Date
    Jun 2000
    Posts
    3,512
    I will add #include in 3.7. There will be more than enough in 3.6 to keep people busy for quite some time.

  10. #10
    Senior Member
    Join Date
    Jun 2001
    Posts
    289
    That's cool.

    The AS editor in 3.6 allowing saves/loads still means easy use of a library of scripts, which is neat.


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