tags:

views:

283

answers:

4

When I try to copy code from eclipse and paste it in the actionscript editor within Flash (CS3 or CS4) nothing gets pasted. Flash does detect there is something on the clipboard and does try to paste, but no content is added.

I can copy paste from eclipse to all other pieces of software running on my computer that have some form of input field.

Both eclipse and flash are set to utf-8.

This annoyance occurs on my macbook with snow leopard installed.

update: I made an interesting discovery just now, when I copy in Eclipse, then paste somewhere else (so just paste) I then can also paste in Flash.

update 2 I've exhausted anything I can try and have given up by blaming Adobe. one extra thing I noticed was when I copy in Eclipse, select text in flash and paste, the text selected gets replaced by nothing. It's like with flash stopping after encountering a badly encoded character.

A: 

Seems like a bug in your editor. But yeah, try your own solution.

update: I made an interesting discovery just now, when I copy in Eclipse, then paste somewhere else (so just paste) I then can also paste in Flash.

Tom
but a bug in which editor, Flash CS4 or Eclipse? And it's not really a solution since it disrupts the CMD/ALT + TAB flow and it takes longer :)
Les
sounds like it's a bug in Flash CS4 as the code is on your clipboard.
Tom
A: 

I've seen similar problems in Eclipse on Windows; in certain Eclipse file-type editors the copy and paste don't work properly. If you are using the HTML or JSP editor in Eclipse try using the text editor and see if your problem goes away. On Windows copy/paste are CTRL-C/CTRL-V, but they are also CTRL-INS/SHIFT-INS. The latter keystrokes sometimes work for me when the others do not.

Mr. Shiny and New
I've tried most, including the new Flash builder beta eclipse plugin, didn't work unfortunately :(
Les
A: 

Perhaps try updating to a newer version of Eclipse. Might fix it. Otherwise - your solution is workable.

Bozho
I didn't always have the problem and actually think it started since a few versions ago of eclipse.
Les
+2  A: 

I'm guessing the bug is within Flash's editor; it's had a long history of gripes from users.

For my projects, I usually create an external .as file and then just load it into my FLA. In your case, it's as easy as:

  1. Copy your current code into an external .as file and save it in the same directory as your .fla.

  2. Let's assume you save it as main.as. In the place where the code used to be, put in:

    include "main.as"

This will solve your problem without having to go through your workaround. External .as files are also generally a good practice if your code is any significant length or there's a chance that someone besides you will be looking at it :)

Goose Bumper
Actually the new project pallet in Flash CS4 has a really nice tool for creating new as files (creates the package structure and constructor for you). However, I use copy+paste a whole lot copying code from previous projects. I use eclipse because it has the best subversion support on mac (imo).
Les