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

trouble pointing animate to class library

Community Beginner ,
Sep 22, 2019 Sep 22, 2019

I am following a tutorial from a book. This time instaead of using flash builder the author is using Flash Pro. I use Animate so thought this would be easy book to follow

 

According to instructions i should point animate at a special class library called com/friendsofed/utils/:StatusBox

 

I know that the files are there and the folder structure is correct. 

I go to file actionscriptsettings and in the source path I navigate to the com folder.

When I compile I get the message: Library path (FlexSDK)/framework/libs/flex.swc does not reslve to a valid file.

 

Am I going wrong in my advanced actionscript settings, setting the source path wrong.

Any help is greatly appreciated. 

1.4K
Translate
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
Community Expert ,
Sep 23, 2019 Sep 23, 2019

Hi.

 

The common approach is to have a root folder for all of your code called something like src and then import your AS files starting from the files/folders within this root folder.

clipboard_image_0.png


So, if all of your code is inside this root folder, your import statement would be:

import com.friendsofed.utils.StatusBox;

 

But according to the error you mentioned, it seems the compiler is complaining about a Flex library that you don't need or shouldn't need.

Try removing it from the libraries paths.


Regards,
JC

Translate
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
Community Beginner ,
Sep 23, 2019 Sep 23, 2019

Thanks for the reply JoãoCésar, here is exactly what is happening.

 

The first time i run the fla I get :

Warning: Library path "$(FlexSDK)/frameworks/libs/flex.swc" does not resolve to a valid file.


C:\Users\Dell\Desktop\FlashWork\AdvancedGameDesign\HelloWorld\src\HelloWorld.as, Line 11, Column 29 1046: Type was not found or was not a compile-time constant: StatusBox.


C:\Users\Dell\Desktop\FlashWork\AdvancedGameDesign\HelloWorld\src\HelloWorld.as, Line 15, Column 27 1180: Call to a possibly undefined method StatusBox.


C:\Users\Dell\Desktop\FlashWork\AdvancedGameDesign\HelloWorld\src\HelloWorld.as, Line 4, Column 33 1172: Definition com.friendsofed.utils:StatusBox could not be found.

 

I then go into Animate>actionscript3 settings and point the source to the com folder on my harddrive.

 

After setting the source path I now only get one error:

Warning: Library path "$(FlexSDK)/frameworks/libs/flex.swc" does not resolve to a valid file.

 

 

 

 

Translate
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
Community Expert ,
Sep 23, 2019 Sep 23, 2019

But do you have a path to the Flex SDK set in the Library tab?

Translate
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
Community Beginner ,
Sep 23, 2019 Sep 23, 2019

Here is my library window im not sure what is going on here

 

as3Settings.jpg

 

 

 

 

Translate
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
Community Beginner ,
Sep 23, 2019 Sep 23, 2019

Here is my Library tab in actionscript settings:

as3Settings.jpg

Translate
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
Community Expert ,
Sep 23, 2019 Sep 23, 2019

Remove the second line.

Translate
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
Community Beginner ,
Sep 23, 2019 Sep 23, 2019

Thanks, i removed the second line. Now when I compile I get no errors but nothing is compiling

 

I could zip the project up and  upload it if there is a way.

Translate
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
Community Expert ,
Sep 23, 2019 Sep 23, 2019

Yeah. There is.

 

You can upload it to a file sharing service like Google Drive, Dropbox, OneDrive, or WeTransfer and then paste the link here.

Or you can PM me if you prefer.

Translate
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
Community Beginner ,
Sep 23, 2019 Sep 23, 2019

Here is a WeTransfer link. I uploaded the project files and the com folder containing extra classes from source files from a book im working othrough. https://wetransfer.com/downloads/0d9f5b9c84042573e7577094c8a660b320190923175455/46344eea7daafce57519...

 

I  almost finished his first book more or less. Foundation Games Design with actionscript3. For that book he was using Flash builder. I had no problems following with Animate. Now he is using Flash Pro in = Advanced Game Design with Flash book and so I thought this would be very starightforward to set up. The author is Rex van der Spuy. He is very good. 

Translate
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
Community Expert ,
Sep 23, 2019 Sep 23, 2019

Thanks.

Here is:
http://bit.ly/2kTcUVb

 

I changed the structure to a more common approach when using Animate.

Please notice that you don't need to provide meta infos inside classes (for stage dimensions, framerate, and so on) because you're using an IDE so you can set this there.

I hope this helps.

 


Regards,
JC

Translate
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
Community Beginner ,
Sep 23, 2019 Sep 23, 2019

Hi Thanks again. I'm not sure I understand what is going on here. according to the book I should get a swf with a message saying Hello World. 

 

Perhaps there is a mistake in the book. Status box is drawing the red rectangle isnt it?

 

Translate
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
Community Expert ,
Sep 23, 2019 Sep 23, 2019

I added a red rectangle and a traced a message indicating that the main class started so you can the structure works.

 

But if you're not seeing the text it was supposed to be displayed, then probably it has something to do with the way fonts are being embedded.

Please review this and you should get what you want.

Translate
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
Community Beginner ,
Sep 23, 2019 Sep 23, 2019

So you placed the code for a red box in the StatusBox class in the com/friendsofed floder?

 

I asked this because I need to access special classes from the com folder. If I am accessing the new classes inside that folder then I will know its all working.

 

Thanks for helping me.

 

Translate
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
Community Expert ,
Sep 24, 2019 Sep 24, 2019

Hi.

 

Yeah. I placed the code inside of the StatusBox class.

 

If you want to use, for exemple, the VectorMath class, your import statement would be:

import com.friendsofed.vector.VectorMath;

 

Remeber to always start the import path from within the root folder.

 

 

Regards,

JC 

Translate
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
Community Beginner ,
Sep 24, 2019 Sep 24, 2019

JC I see what you are saying that you placed a cube in the StatusBox.as script. I see the cube but the statusbox script should show a HelloWorld message.

I have uploaded the pdf I am working from. I am on page xxiii

 

Here is the link. I hope you dont mind taking a look for me. You have the HelloWorld folder.

 

https://we.tl/t-bqhhtpcyEl

 

regards 

John 

Translate
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
Community Expert ,
Sep 24, 2019 Sep 24, 2019

What I did in fact was to just reorganize the code structure. I just added that rectangle so you can see that it is working.

 

About your text not showing up, as I said before, it has to do with font embedding.

 

An easy way to see your text will be to comment out the following line in the StatusBox class:

_textField.embedFonts = true;

 

What I suggest to you is to create a text field in the IDE, then embed the fonts you need and then you can throw the text field away.

 

 

Regards,

JC

Translate
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
Community Beginner ,
Sep 24, 2019 Sep 24, 2019

Thanks JS you are very good help to me. 

I commented out the line you said.

I don't want to make my own text appear though. I want to see the text appear from the original code. Then I will be able to trust and go ahead with the rest of the examples in the book.

Did you possibly take a peek at the pdf I uploaded? Can I be cheeky and ask you to look at it.  It says there exactly what I am trying to do. Its in the first few pages of the document in the section Introduction/Setting Up Your Work Environment. If you cannot replicate this workflow then I will have problems with my limited knowledge.

As far as I can see Animate must point to the com folder but not in the projects src folder as this will mean copying the com folder into each and every examples src folder. Then when its pointed at the new classes folder Animate also needs to point to flexSDK. If im understanding this right.

Thanks again for your interest.

John

 

Here is the link. I hope you dont mind taking a look for me. You have the HelloWorld folder.

 

https://we.tl/t-bqhhtpcyEl

Translate
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
Community Expert ,
Sep 25, 2019 Sep 25, 2019

Hi again.

 

Sorry. I didn't have the time to take a good look at that PDF.

 

But, anyway, the hello world message is being show for me.

clipboard_image_1.png

 

And when I suggested to you to insert a text field I didn't me that you should insert your own text. I suggested this approach so you could embed a font via the IDE and not via code.

 

I hope it makes sense.

Translate
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
Community Beginner ,
Sep 25, 2019 Sep 25, 2019

Hi your help is invaluable really. Sorry to bug you on this topic. So the Hello World image you sent there was created by the authors code not yours?

Translate
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
Community Expert ,
Sep 25, 2019 Sep 25, 2019

By the author. I didn't generate that.

Translate
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
Community Beginner ,
Sep 25, 2019 Sep 25, 2019

Haha Its there. Hello World. Next to the red box. I can grab hold off the text and move the red box. Did you put this functionality in there :). Now I am happier.

Anyway I think the text was there all the time Its just so small.

I am unsure why the text is coming out so small but it looks like I will be able to work through the other examples in the book.

So if I save that .fla file you sent  it should have the correct folder structure set up in the actionscript setting tab to deal with the other examples from the book. That is by putting the com folder in src folder for each example. I can live with that.

 

Hopefully I can continue. Your help has been great. 

Thank You 

 

 

Translate
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
Community Beginner ,
Sep 25, 2019 Sep 25, 2019
aah sorry. I try the next example with the same setup and now I get ./src/ does not resolve to a valid directory.
Translate
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
Community Expert ,
Sep 25, 2019 Sep 25, 2019

Excellent!

 

Yeah... That text is very unnoticeable!

 

You can also double-click that box. But I didn't apply any of these interactivities.

 

But I'm glad that now you can continue following the book!

 

Have a wonderful week!

 

 

Regards,

JC

Translate
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
Community Expert ,
Sep 25, 2019 Sep 25, 2019

Please make sure you have a folder called src where your FLA is located.

Translate
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