A newb that needs some help to get an example going

Added by Jeffrey Vermeer 565 days ago

Hello everyone,

I recently came up with the idea of making an online flash game and my search led me here, to Union. So far I only really have experience with AS2 so that's already quite a change to have to use AS3 ^^
Anyway, today I've been looking at some examples and though I don't understand a lot of it yet I did try to get the finished code parts to work. I've been working with the first time application tutorial (http://www.unionplatform.com/?page_id=44&page=7). Now I think I set up everything the right way in the fla file, but I get this error:

VerifyError: Error #1014: Class net.user1.reactor::Reactor could not be found.

at global$init()

In the fla file I now have a single movieclip on the stage named UnionChat and I enabled the "export for action script" stuff in the properties. I'm using the latest version (alpha 7?). Afaik it looks like everything in the fla file is ok now as this error doesn't seem to come from flash it self. I also put everything (the Union library, my project fla and as file) in the same folder so it should find it all, right?

Anyway, any help would be appreciated to get this example to work. Probably I forgot something, but I think I didn't xD


Replies

RE: A newb that needs some help to get an example going - Added by colin moock 564 days ago

hi jeffrey,
sounds like you don't have reactor's .swc file in your library path.

Locate Reactor's main class library .swc file in the main directory of the release .zip. The .swc file is named Reactor_1.0.0.x_y.swc, where x is the build number and y is the release name.

Add that .swc file to your project's library path under File > Publish Settings... > Flash > ActionScript 3.0 > Settings > Library Path (click the + button and browse to the .swc).

colin

RE: A newb that needs some help to get an example going - Added by Jeffrey Vermeer 564 days ago

Jup, that was it, it works now, thanks Colin ;)
I looked at the help files for the library path thingy, but all I could find was a description, not how to actually use it or where to even find it. But anyway it works now ^^

RE: A newb that needs some help to get an example going - Added by colin moock 563 days ago

thanks for the feedback. i just added some docs and screenshots to that page to help others get started:

http://www.unionplatform.com/?page_id=44

colin

RE: A newb that needs some help to get an example going - Added by Jeffrey Vermeer 563 days ago

Looks good to me Colin ;)

But now I have another issue. When I compile in the editor it all works fine, I can even join the same room on two separate computers ^^ But if I just try to run the generated swf from windows explorer I get the question if I want to allow the connection to tryunion.com and I have two choices: Ok and Settings. So I first thought, well it's probably something in my settings that's blocking it so I'll just look there, but it was set to ask me, which should be fine. But to be sure I changed it to always allow, but even then it seems the connection is blocked. So I added it to the exception list, still blocked. I can see the two text spaces in the swf, but it seems to block the connection to tryunion.com (at least I never get the message it's connected). Now it says I need to restart the application, but I don't know what application, I assume it means flash, but closing the browser and all flash related programs doesn't solve the problem either.

Help would be greatly appreciated :)

Oh btw, I did find a temporary solution by creating a so called projector from the swf file, that works fine. And as the game (I'm hopefully going to develop ^^) will probably be outside the browser this shouldn't be a big issue, but if I ever want to develop an online game I can't use exe's.

RE: A newb that needs some help to get an example going - Added by colin moock 563 days ago

hi jeffrey,
you are running into Flash Player's security settings. tryunion.com is configured to allow connections from .swf files posted on any website and also from .swf files running locally on the desktop. if you post your .swf file to the web and access it in a browser, you should not see any security warnings. if, on the other hand, you run your .swf file off your local machine, you will see a security warning. to allow your .swf to connect to tryunion.com, you have three options:

1) Export your .swf as a projector (you found this option already)
2) Export your .swf as an AIR application
3) Manually add trust to your .swf file, as follows:

i) Open the online Flash Player Settings Manager by browsing to the following web page:

http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html

ii) Under Global Security Settings > Always trust files in these locations, click Edit locations > Add location....

iii) Enter or browse to the location you wish to trust.

iv) If your .swf is already running, quit the Flash Player instance in which it is running, and restart your .swf file.

The preceding four steps should work, but you likely don't want to force your users to follow them. if you intend to distribute your game for local desktop play, you are better off packaging it as a projector or AIR app.

colin

RE: A newb that needs some help to get an example going - Added by Jeffrey Vermeer 563 days ago

Yeah I tried option 3, but for some reason the security kept popping up, but if you say it won't pop up when it's in a browser that's fine ;) Thanks again ;)

RE: A newb that needs some help to get an example going - Added by colin moock 563 days ago

would you mind posting a screenshot of the security dialog that "keeps popping up"?

colin

RE: A newb that needs some help to get an example going - Added by Jeffrey Vermeer 563 days ago

Ok I tried it again and now it works -.- This time I used the browse to file file though, instead of copying the link to the last file.
Anyway the one that popped up was this: http://nubyonrails.files.wordpress.com/2007/08/flash-security.jpg

RE: A newb that needs some help to get an example going - Added by colin moock 563 days ago

that dialog looks it was triggered by an attempt to communicate with JavaScript over ExternalInterface or fscommand, not by an attempt to communicate with Union. take a look at the security notes for the call() method here:

http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html

are you using ExternalInterface?

colin

RE: A newb that needs some help to get an example going - Added by Jeffrey Vermeer 563 days ago

Nah, this is just an image I took from the web ;) With mine the local file and what it tries to connect to is different (namely: chat_test.swf tries to connect with tryunion.com).