API has changed, older code won’t run

Software: Away3D 4.x

ken1171, Newbie
Posted: 31 October 2011 10:29 PM   Total Posts: 13

I am trying to learn Away3D but the only books on the subject were for version 3.6, and the API seems to have changed so much that I can’t even get the first code examples to work on current version 4. For example, I could find a “PointLight” class, but no “PointLight3D” that was used in version 3.6 source code. No wonder the source code from the books won’t execute - the API has changed!

If I can’t use the books, than what can I use to learn this? Even the most elementary things in the books won’t work in version 4…

I use Flash Pro CS5, and would appreciate any help with this.

UPDATE:
=========
I tried the local tutorials for version 4, and the simplest code example to just create a View3D object builds with no errors, but gets a runtime error:

“VerifyError: Error #1014: Class flash.display3D.textures::Texture could not be found.”

For this very simple code in Flash Pro CS5:

package {

import away3d.containers.View3D;
import flash.display.MovieClip;

public class MyFirstApp extends MovieClip
{
  private var view:View3D;

  public function MyFirstApp() {
  view = new View3D();
  view.x = 275;
  view.y = 200;

  addChild(view);
  } 
}
}

I have installed the latest Away3D 4, FP11 and respective globalplayer.swc. The code builds with no errors, but I get this exception when executed.

Can anybody help me with this?

   

bubba_169, Newbie
Posted: 31 October 2011 11:04 PM   Total Posts: 1   [ # 1 ]

I’m not sure how you add it but I think you need to add -swf-version=13 to the compiler parameters. I had a similar problem and that fixed it but I use FlashDevelop. I’ll have a play with CS5 and see if I can find the option.

   

Rant, Newbie
Posted: 31 October 2011 11:10 PM   Total Posts: 8   [ # 2 ]

I ran into the same problem using either Flash Pro or Flash Builder and the problem was that the player used in windows is the one ActiveX one wich i didnt had up to date it was 10.2. So i installed the last version of the activeX player and the problem was solved.

U can check if its the same problem if u open up the swf and the player u get its not a 11 version.

   

ken1171, Newbie
Posted: 31 October 2011 11:11 PM   Total Posts: 13   [ # 3 ]

Thanks for your help! Seems like I already have it set to that version. I did it manually:

C:\Program Files (x86)\Adobe\Adobe Flash CS5\Common\Configuration\Players\FlashPlayer11.xml

==>

What else could it be?

   

ken1171, Newbie
Posted: 31 October 2011 11:13 PM   Total Posts: 13   [ # 4 ]
Rant - 31 October 2011 11:10 PM

I ran into the same problem using either Flash Pro or Flash Builder and the problem was that the player used in windows is the one ActiveX one wich i didnt had up to date it was 10.2. So i installed the last version of the activeX player and the problem was solved.

U can check if its the same problem if u open up the swf and the player u get its not a 11 version.

I thought this one was only for the Microsoft IE browser. I don’t understand how could this affect Flash CS5.

But that’s quite possible! I will update my ActiveX plugin and try again. ^_____^

   

ken1171, Newbie
Posted: 31 October 2011 11:24 PM   Total Posts: 13   [ # 5 ]
Rant - 31 October 2011 11:10 PM

I ran into the same problem using either Flash Pro or Flash Builder and the problem was that the player used in windows is the one ActiveX one wich i didnt had up to date it was 10.2. So i installed the last version of the activeX player and the problem was solved.

U can check if its the same problem if u open up the swf and the player u get its not a 11 version.

Ok, I have just closed everything, downloaded the latest FP11 ActiveX plugin, installed it and tried to run that code again. Same error, nothing changed.

Just in case, I have also reinstalled the latest FP11 64-bits from Adobe again, and still the same thing. I can actually build the SWF with no errors, but it fails to execute because of the runtime exception:

VerifyError: Error #1014: Class flash.display3D.textures::Texture could not be found.

Curiously, I also tried to execute the “shallow water” demos on Firefox and I get only the interface to show up, and blank screen for the rest. I could execute them before with the “incubator FP11”, but not with the new version. I wonder if the changes on the new FP11 is breaking compatibility with the older demos? I am really confused… T_______T

   

Rant, Newbie
Posted: 31 October 2011 11:43 PM   Total Posts: 8   [ # 6 ]

Welll to see if its the player u can download the player projector and drag the swf to the projector if u get the same problem its something else but if it works then ur problem its with the player. If ur problem its the player u can change the players in: C:\Program Files (x86)\Adobe\Adobe Flash CS5\Players for the new ones i think that solved my problem in Flash Pro. Remember to back up the entire folder before making any changes.

U can download it from: http://www.adobe.com/support/flashplayer/downloads.html use the debugger.

So far i have made it work with Flash Pro CS5.5 and Flash Develop 4 i havent tried with Flash Builder 4 Premium.

   

ken1171, Newbie
Posted: 31 October 2011 11:50 PM   Total Posts: 13   [ # 7 ]

But isn’t Away3D 4 code only playable with FP11? My only other option would be FP10, but I think it doesn’t support the API, does it? I tried to recompile targeting FP10 and I got lots of errors.

Anyway, this code doesn’t do anything that could be “seen”. All I did was to create a View3D object and add it to the display list. I don’t know how to do anything else because the only available books are for A3D 3.6, and the code doesn’t work anymore because the API and classes have changed. T_____T

   

Rant, Newbie
Posted: 01 November 2011 01:24 AM   Total Posts: 8   [ # 8 ]

Well i think i didnt make myself clear enough.

For Away3D v4 u need to run it in FP 11 so what i was trying to tell u is download the flash player projector and after compiling the code into a swf u drag that swf file to the projector. if u dont get an runtime error code its fine and u have a problem with the player installed on Flash Pro CS5 and u need to change the player from the directory i mentioned above. If u get a run time error then i dont know what else could be.

Also from the code u pasted in the original post that code doesnt generate anything at all u will see a blank screen. So if u want to be sure the code its playing properly in the projector just try this code and compile it then test it on the projector.

package  
{
 import away3d
.containers.View3D;
 
import away3d.debug.Trident;
 
import flash.display.MovieClip;
 
import flash.events.Event;

 public class 
Viewer3D extends MovieClip
 {
  
private var _View:View3D;
  
  public function 
Viewer3D() 
  
{
   
// Create the View
   
_View = new View3D();
   
_View.backgroundColor 0x666666;
   
_View.antiAlias 4;
   
this.addChild(_View);
   
this.addEventListener(Event.ENTER_FRAMEonEnterFrame);
   
   
// Create Axes Reference
   
var _Axes:Trident = new Trident();
   
_View.scene.addChild(_Axes);   
  
}
  
  
private function onEnterFrame($event:Event):void 
  {
   _View
.render();
  
}
 }

U should see a gray screen with a point in the center and 2 lines, wich are the y and x axis. If u see it then the code its working and u need to change the player in the flash directory, or u can compile the code and drag it into the projector to test ur code.

   

ken1171, Newbie
Posted: 01 November 2011 11:33 AM   Total Posts: 13   [ # 9 ]
Rant - 01 November 2011 01:24 AM

Well i think i didnt make myself clear enough.

I think you are right. After all, I can compile the code without errors, and the exception only happens in runtime, so it must be the player. I’ve executed the SWF with the projector player version and it worked. ^_____^

I have downloaded the debugger FP11 version “flashplayer_11_plugin_debug_32bit.exe” and had it installed, but it didn’t fix the problem. I still get a run time exception. The player configuration in Flash CS5 seems to be correct:

<player id="FlashPlayer11" version="13" asversion="3">
   <
name>Flash Player 11</name>
   <
path builtin="true"/>
   <
playerDefinitionPath as2="$(UserConfig)/Classes/FP10;$(UserConfig)/Classes/FP9;$(UserConfig)/Classes/FP8;$(UserConfig)/Classes/FP7" as3="$(AppConfig)/ActionScript 3.0/FP11/playerglobal.swc" /> 

In the “C:\Program Files (x86)\Adobe\Adobe Flash CS5\Players” folder the FlashPlayer.exe I found was actually FP10. There are also flash players in the “debug” and “release” folders, and they are all FP10 versions. I tried manually replacing the files in the “players” and “debug” and “release” folders, but I still get the exception when trying to execute from Flash CS5.

“VerifyError: Error #1014: Class flash.display3D.textures::Texture could not be found.”

What’s the proper way to have those upgraded to the FP11 version? I already know the SWF builds fine and works when dragged over the projector FP11. It’s just Flash CS5 that cannot execute it.

There are 3 versions of FP11 debugger:

* ActiveX plugin
* Netscape plugin
* Projector content debugger

And also the regular projector version. Where exactly do they go?

   

Rant, Newbie
Posted: 02 November 2011 02:04 AM   Total Posts: 8   [ # 10 ]

I made it work changing \Players\FlashPlayer.exe and \Players\Release\FlashPlayer.exe with the projector (last option in the download page). And \Players\Debug\FlashPlayerDebugger.exe with the projector content debugger (third option on the page).

   

ken1171, Newbie
Posted: 02 November 2011 02:15 PM   Total Posts: 13   [ # 11 ]
Rant - 02 November 2011 02:04 AM

I made it work changing \Players\FlashPlayer.exe and \Players\Release\FlashPlayer.exe with the projector (last option in the download page). And \Players\Debug\FlashPlayerDebugger.exe with the projector content debugger (third option on the page).

Makes sense, I’ve tried that as well, and I still get the runtime exception. I renamed the files to match the ones in those folders, but since it didn’t work, I am not sure that’s what I should had done.

Did you do anything else besides replacing those files? There must be something else I am missing. Dragging the SWF over the this FP11 projector file works fine, but placing it at the “players” folder (renamed to flashplayer.exe) has no effect. I have also replaced the one at the “release” folder with the debug projector version (renamed to flashplayer.exe), also to no avail.

Damn it, Adobe should had made this update process simpler… O____O

   

KeithT, Newbie
Posted: 02 November 2011 03:54 PM   Total Posts: 6   [ # 12 ]

I had this problem and think you are using the “old” examples that you can download from the download page. As far as I can work out these now don’t work anymore because the design of away3d 4 has been changed recently which “broke” these examples (which in some ways is fair enough it’s in Alpha, although taking these broklen examples down would have been good).

If you get the examples from the GitHub, (there are a lot less of them) they do actually work with the current away3d core.

I also had/have huge problems with the FP11 player in IE8 which I can’t get to run properly with the working examples, although they work fine in Chrome on the same machine.

   

ken1171, Newbie
Posted: 02 November 2011 04:26 PM   Total Posts: 13   [ # 13 ]
KeithT - 02 November 2011 03:54 PM

I had this problem and think you are using the “old” examples that you can download from the download page.

Perhaps you have missed some of the messages above, but I am not using old code here. The program builds without errors, and can be executed by dragging the SWF over the standalone FP11 projector - the same one that was placed on the “players” folder.

If it were because of old code, it wouldn’t even build the SWF because of compiling errors, and even less execute in any version of the flash player.

This is definitely related to the flash player used by Flash CS5. Somehow replacing the files in the “players” and “release” folders doesn’t seem to be enough. There is something else I am missing…

What could that be?

   

Rant, Newbie
Posted: 02 November 2011 07:16 PM   Total Posts: 8   [ # 14 ]

Ok i think i found why u are still getting the error. Seems like Flash Pro uses an internal player. I tried running the code with the settings of flash player 11 I created and i get the same error.

I am working on AIr 3.0 app with Away3D, and the weird thing its that i can run the App without a problem in Flash Pro. So I was wondering why the Air version its running and not the FP11 one. Then I changed the publish settings of my Air app to FP11 and i got the same error. Then I ran with the Air setting and got it running, but then i changed back to FP11, this time the code ran without a problem. Its weird i dont know why. Adobe must do something to make FP11 work in Flash Pro.

Trying to figure out a way to make it work as it should i found this link:
http://blogs.adobe.com/rgalvan/

I think that the only way u can debug or test it is using the browser. Also u can try to get the same settings i have and test as if u were doing an Air 3.0 App. If u want to try this u will need to follow this tutorial in order to get the AIR 3.0 SDK running on Flash Pro.

http://kb2.adobe.com/cps/908/cpsid_90810.html

I think its the same for CS 5, but to be sure back up everything u change.

Also if ur code its taking to long to compile be sure to check:
http://away3d.com/forum/viewthread/1253/

This will make it a looooooot faster to compile. I dont know why Flash Pro takes that long to compile code but well.

   

ken1171, Newbie
Posted: 02 November 2011 07:30 PM   Total Posts: 13   [ # 15 ]

Thanks for the feedback! Looks like I already have everything setup, and replacing the FP10 for FP11 in the “players” folder has no effect in Flash Pro CS5 because, like it was said in the article, that one cannot be updated since it is an “internal player”.

The only way to go is to “test on browser”, then. This is not a solution but rather a workaround, since this can’t actually be fixed by any of us. T___T

Thank you guys again! ^________^

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X