• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Flash CS6: Code hinting doesn't work in AS3 document

Guest
Jun 22, 2012 Jun 22, 2012

Copy link to clipboard

Copied

Hi,

For some reason code hinting is not working at all in an AS3 class document in Flash CS6. It works fine on the timeline. For instance:

1. Create a new AS3 class, name it "MyClass"

2. Save the doc immediately (in CS5 code hinting would not work until the class file was saved)

3. After "class MyClass" I type " extends Movi" and press Ctrl+Space, expecting to see hints for "MovieClip" etc like it did in CS5. In CS6 I get nothing. If I type out the whole word "MovieClip" and press Ctrl+Space I still get no hints.

What might be wrong?

Thanks!

Aaron

Views

17.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 23, 2012 Jun 23, 2012

Copy link to clipboard

Copied

What helped me was making sure Flash CS6 was up to date (help->Updates...).

Then I went to Edit->Preferences->ActionScript and I unchecked and then rechecked Code Hints and changed cache from 800 files to 3000 files (delay of 0). I presume because there just are so many classes it might run out of memory before getting to all of them. 3000 might not even be enough.

I then went into a frame script and typed: class myClass extends Movi(CTRL+PERIOD) and it offered completion options.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 06, 2012 Jul 06, 2012

Copy link to clipboard

Copied

Hm, well it seems that code hinting operation is not as consistent as I thought it always was. Even in CS5 if I create a new AS file and save it code hinting doesn't always work, even built in classes. It seems to only work if that AS file is saved to a file location that is a classpath of an FLA, and maybe I even have to have the FLA open.

Aaron

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 06, 2012 Jul 06, 2012

Copy link to clipboard

Copied

Code hinting works on classes that are "known" in your context. Adding in a source path won't be enough like it is for Flash Builder. You typically need to import the class first. If you import it in Scene 1, frame 1 and then dive into a MovieClip, the completion may not even be available there unless you put another import statement inside the MovieClip. I agree, the completion needs some help.

If you're just using the built-in AS editor on class files (not frame scripts) you should try the free FlashDevelop app which has excellent completion.

You'll get MUCH better completion if you use external packages and classes. The built in ActionScript panels completion needs some enhancements in frame scripts on the timeline but it's much better when editing pure external .as files.  Though I'd never use it over FlashDevelop. Nor would I use FlashDevelop over Flash Builder.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 06, 2012 Jul 06, 2012

Copy link to clipboard

Copied

I am actually talking about using external class files entirely, I don't have any problems on the timeline. Consider this code snippet:

import flash.display.MovieClip;

var mc:MovieClip;

On the timeline if I type "mc." I get a list of MovieClip properties and methods.

In an .as file I don't unless the .as file is in a classpath for an open FLA. Admittedly, I never noticed this until now for some reason, and it kind of makes sense, since a .as file could be AS2 or AS3, and the only way to distinguish would be the FLA that file is associated with. I do wish that having a valid AS3 file open in Flash would give you code hinting for the built in classes at least, though.

Thanks for the suggestion on FlashDevelop, it's a superb editor and I use it when I start coding heavily, but don't habitually go to it because switching between two apps is mildly annoying.

Aaron

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 06, 2012 Jul 06, 2012

Copy link to clipboard

Copied

The presence of package {} is enough for the editor to know if you intend AS2 or AS3 as there is no support for packages in AS2.

Between the great code completion, project manager, class outline view and IDE integration I think it's worth a second look. It entirely depends on how complex your project is if these features are invaluable to you or not. It shouldn't be too annoying as a Flash IDE project will launch your FLA directly from FlashDevelop so you don't need to flip between them while coding and output is captured in FlashDevelop.

I use FlashDevelop quite a bit outside AS. I use it to edit XML and text files with specific encodings when I do language translations. It does a very good job of handling other situations. I guess that's why I keep it around.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Aug 08, 2012 Aug 08, 2012

Copy link to clipboard

Copied

Hi Aaron,

You are right that for Code Hint to work

1. You have to have the .as file in the associated .fla's class path

2. Associated .fla file should be saved

3. Associated .fla file should be opened

Thanks!

Mohan

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jul 07, 2012 Jul 07, 2012

Copy link to clipboard

Copied

FlashBuilder is much better these days, and if you have Flash Pro, you should already own it.

On another note: I find that sometimes these thing happen because either the FB or FP project has "issues." If you're using a FP project, you could try deleting the project but leaving the files, then recreating the project.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 16, 2012 Oct 16, 2012

Copy link to clipboard

Copied

The reality is this.  Code hinting for AS3 does not work in CS6 without much more input than was necessary in CS4.  I was able to get it to work once and that is it.  If anyone at Adobe can respond to this with an actual fix it would be greatly appreciated.  I have posted symilar responses but no one at Adobe can give a solid answer.  I have tried everything posted here and on several other sites wtih no luck in fixing the problem.  It has left me to use CS4 then open it in CS6 if I need to utalize any of its features.  Please post something that actually fixes the problem without having to go through more than 20 steps to resolve an issue that was clearly not present in CS4.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 18, 2012 Oct 18, 2012

Copy link to clipboard

Copied

I know you're very happy with editing code in the Flash Pro IDE but have a look at the video on "AS3 Signals Tutorial" in this blog. Not only will you learn something but he's using FDT in Eclipse to edit and run AS3. Notice how fast he can write code due to the completion abilities (auto-generate imports, functions, properties, etc). The color choices he made are another flexibility although I'm not a huge fan of his color choices, but that isn't the point.

http://pv3d.org/page/2/?s=rsjfdqoyiil

Aside being a great tutorial on a good concept (signals) I think it illustrates how moving to a different code IDE can benefit you greatly in speed. I haven't edited AS in Flash Pro since pre-MX. FDT/Eclipse is free, btw. So is Adobe's FlashBuilder Standard if you're unemployed or are a student (thanks Adobe!).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 18, 2012 Oct 18, 2012

Copy link to clipboard

Copied

Sinious, I don't think you understand... or maybe it's me.what you are saying is that if I create an animation or website or any of the other things such as games, I am to try to create actions for the multitude of symbols and tweens and everything else that really fules a project in another program?  I've looked at what you suggested and I don't think you understand.  I've tried flash builder but if there is a way to associate code directly from it to symbols on the timeline I haven't been able to find it.  To better understand the issue create a short flash project and try to code it in cs6.  Please keep in mind that not all flash users can code from memory and to have to now learn and utilize another piece of software is just not feezable.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 18, 2012 Oct 18, 2012

Copy link to clipboard

Copied

I do tend to think in coder terms a great deal more than designer so that's where we may have a hiccup.

The original post was about code hiinting not working. The video was showing a free tool to write code in that not only is excellent at code hinting, but also auto-generates functions, import statements and colors code any way you like it. That's what you wanted, and a whole lot more.

To answer your statment about coding outside the flash timeline in an external file and that code having access to objects on your timeline, the answer is it absolutely does. Keeping your code in external files not only lets you choose a different IDE to edit code in but also centralizes code so you don't need to skip around a timeline to find it. When your game is complex, this is essential.

Here's a couple very simple examples to illustrate this. One uses a document class, one imports a class and uses it. Both of them gain access to the main timeline where a premade blue square with an instance name exists. They both animate the square slowly across the screen.

http://www.ertp.com/tmp/ExampleExternalClass.zip

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 18, 2012 Oct 18, 2012

Copy link to clipboard

Copied

OK I need to make this as simple as possible.  Here is a scenario. 

I'm in an actionscript 3.0 project in flsah.  I create a box convert it to a symbol and name it box.  I then give it an instance name box_mc and I want to add action script to it.  I go into the actions pannel and type in box_mc.  and nothing I can't even click on the code hints button as long as box_mc. has the (.) operator.  In fact to get any code hints to come up I need to change the dot to a comma.  I really appreciate your help but your missing the point.  I don't know how to interface flash with flash builder I've looked at some videos but I'm not keen on all of these extra steps.  By the way the example you sent was again appreciated but not helpfull.  I can code simple things like this if I need to but I don't have the time to go through all of this to acheave something that worked perfectly in a previous verson.  Your example doesn't show how flash interacts with a different IDE so I'm not really sure what it was for.  Thank you though.  If you work for Adobe perhaps  you could let me know how to simply get code hints to work in flash CS6 that is all I want to do.  I was speaking wtih a teacher at a local college in town and his students are livid that they can't practice and learn the way they could with cs4.  Again thank you for your help.  I'm going to try to get this to work somehow.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 19, 2012 Oct 19, 2012

Copy link to clipboard

Copied

I do not work for Adobe, just a fellow forum dweller.

The example was made quickly because you said this:

I've tried flash builder but if there is a way to associate code directly from it to symbols on the timeline I haven't been able to find it.

Now you know how.

I'm sorry but I don't even have Flash CS6. I still use CS5.5 because I use Flash Builder 4.6 for everything I do. I merely use Flash Pro to generate quick libraries full of goodies and export a SWC to use in Flash Builder.

I realize it's obvious but you did ensure your preferences had hinting both enabled and the delay set low (or zero)? I can only show you a CS5.5 preference panel, I'm not sure if it's the same. Note one important thing in this photo which is "Cache size". I have mine on 800 files which seems to be fine. If you're pointing toward a HUGE library of classes you may want to increase that number and check completion again.

prefpane.JPG

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 19, 2012 Oct 19, 2012

Copy link to clipboard

Copied

It still does not work.  I have tried this but to no avail.  I really appreciate the reply but it just does not seem to work for me.  By the way if I came off as rude I truley apologize.  I guess the questions regarding the code hinting are comming from a point that is prior to trying flash cs6 I didn't have to know what a class file was I just created a symbol and programed it.  Most of us learning flash and as3 aren't used to having to understand anything other than typing i.e. blue_mc. and getting code hints that guide us in the right direction.  I do really appreciate all of your help and solving the problem has made me want to learn scripting even more but for now I will have to work in cs4 until Adobe "fixes" or implements a "better" way for non developers to learn and use Flasn.  Again thank you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 22, 2012 Oct 22, 2012

Copy link to clipboard

Copied

If you did what I mentioned in the second post (when I was trying the CS6 trial) via unchecking and checking hinting and it still doesn't work on the timeline you might, lastly, want to reconsider a reinstall. The time lost on things like this makes the time it takes to just reinstall Flash seem very small. If that doesn't help, you're really up a creek without a paddle ><.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 24, 2019 Oct 24, 2019

Copy link to clipboard

Copied

Perhaps someone still finds themselves in this same situation today (2019). 

 

Check to make sure your .as file is in the same folder as your .fla file. Code hinting should start working again after they're co-located. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 13, 2012 Nov 13, 2012

Copy link to clipboard

Copied

I have the same problem!  I have already followed the suggestions to uncheck the code hint and re-check.  Changed cache size from 800 to 3000 files.  However, the code hint still doesn't show up.  Any other thoughts to make it work?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 25, 2019 Oct 25, 2019

Copy link to clipboard

Copied

LATEST

There is another case where code hinting can fail. If your FLA and AS are in a folder at the same level as a lot of other folders that have AS3 in them, all of that other code is checked to see if it helps with the hinting. Taing your project and putting it one more folder deep may be enough to solve that issue.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 11, 2013 Apr 11, 2013

Copy link to clipboard

Copied

Not sure if this will help you guys,

I've tried to create new .fla and reset the cached

folder mentioned above and everything works just fine for me!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 10, 2014 Jun 10, 2014

Copy link to clipboard

Copied

Sometimes when I am working through "projects" window, I lose code hinting. That is because i forget to open the main FLA file. Silly

Creativity is in human nature

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines