Skip to main content
February 17, 2009
Question

confused with as2 vs as3

  • February 17, 2009
  • 4 replies
  • 472 views
hi

i am new at flash and have been following training i purchased from total training and have been building my website in flash using the action script 2 setting with some degree of success. i have now however hit a brick wall. i am trying to make several different videos play in a single window however it gives me a warning that what i am trying to do requires action script 3. but if i select action script 3 it breaks my entire website as it uses behaviors for loading external swf's into a symbol for my different pages of the site. (this was the method used by John Ulliman) it would appear that action script 3 (the newer format) is preventing me from completing my site. what gives. why does action script 3 not support behaviours? what is the replacement method for this?

cheers

Angus
This topic has been closed for replies.

4 replies

February 19, 2009
Hi David

I will check this asap and get back to you. once again thanks for the generous help

angus
Inspiring
February 18, 2009
Angus,

> First of all, I would like to thank you for taking the
> time to answer my questions.

Sure thing. :)

> It turns out that I figured out this morning what I was
> doing wrong. I had inserted unnecessary frames into
> one of my fla's

I do that, occasionally. Fortunately, that one's easy to fix.

> now the video gallery works fine, however I have a
> new problem, when i run a test on my local machine
> by hitting alt enter the gallery does what its supposed
> to do,

Okay.

> but when i test it on my server the video does not load
> and play.
>
> any idea why?

The first thing that comes to mind is this: have you uploaded your
video files to the server? If so, are the relative positions of the video
files, SWF, and HTML document the same as they are on your local hard drive?


David Stiller
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design."


February 18, 2009
Hi David

First of all, I would like to thank you for taking the time to answer my questions. It turns out that I figured out this morning what I was doing wrong. I had inserted unnecessary frames into one of my fla's so the timeline had reached the end and stopped playing before my video from the other inserted swf even had a chance to begin playing. so i just deleted all the frames bar the first keyframe and now the video gallery works fine, however I have a new problem, when i run a test on my local machine by hitting alt enter the gallery does what its supposed to do, but when i test it on my server the video does not load and play.

any idea why?

thanks in advance.

angus
Inspiring
February 17, 2009
Angus,

> i am trying to make several different videos play in a single
> window however it gives me a warning that what i am trying
> to do requires action script 3.

If your FLA file is already configured for AS2, I'm trying to imagine
how you're seeing a warning about AS3. Maybe you started typing
ActionScript 3.0 code, even though your publish settings are configured for
AS2?

How are you playing your vidoes ... is this with the FLVPlayback
component, or with NetConnection/NetStream?

> but if i select action script 3 it breaks my entire website as it
> uses behaviors for loading external swf's into a symbol for my
> different pages of the site.

Aha. Yes, Behaviors don't work in AS3 because they require the on() or
onClipEvent() functions, which are no longer supported.

> it would appear that action script 3 (the newer format) is
> preventing me from completing my site. what gives.

In this case (it sounds like), it's not so much AS3 blocking you as it
is your attempt to mix AS3 with AS2. If you stick with AS2, you can go
right on using Behaviors; it just means you'll have to learn the AS2 way of
playing your numerous videos. If you choose to convert to AS3, you'll have
to load your external SWFs without the assistance of Behaviors.

> why does action script 3 not support behaviours?

Technically, it's because Behaviors rely on the on() or onClipEvent()
functions, neither of which are supported in AS3. Why that's so, I'm afraid
I can't explain. Lots of people miss Behaviors, but the interesting thing
is, they're nothing more than automatically generated code -- code from a
canned set of templates. The Behaviors panel (at least, in AS2 documents)
does nothing but write the code on your behalf. In a sense, that's
convenient, because it helps you avoid typing; in another sense, it's
problematic, because the feature shields you from learning how to write code
yourself.

> what is the replacement method for this?

Because most of your site is already finished in AS2, my hunch is that
it would take less effort to code up your video efforts in AS2. What code
have you tried using so far?


David Stiller
Co-author, Foundation Flash CS4 for Designers
http://tinyurl.com/5j55cv
"Luck is the residue of good design."