SapphireSteel Forum
Welcome, Guest. Please login or register.
August 24, 2017, 04:18:18 AM

Login with username, password and session length
Search:     Advanced search
Welcome to the SapphireSteel forum - for discussion of the Sapphire and Amethyst IDEs
4074 Posts in 848 Topics by 708 Members
Latest Member: dcham_inbsys
* Home Help Search Login Register
+  SapphireSteel Forum
|-+  General
| |-+  Amethyst
| | |-+  MovieClips in Referenced SWC files
« previous next »
Pages: [1] Print
Author Topic: MovieClips in Referenced SWC files  (Read 7311 times)
digxstudios
Newbie
*
Posts: 20


« on: August 02, 2013, 04:33:39 PM »

Hi,

I am currently investigating the possibility to replace Flash Builder with VS2012 + Amethyst.

So far i'm impressed with the quality of Amethyst, but am facing an issue i dont know how to resolve.

I have an existing project that i imported which links to MovieClips from external swf by having SWC files for those swf files.

The issue i have is that at compile time, its not finding the classes that are in those swc libraries. I do have those swc in the References, and i can see the classes whe i use the object browser.

Here is the error i get:

Error : Call to a possibly undefined method TechCancelBtnMc.

here's the faulted line:

[Bindable] private var cancelBtnMc:MovieClip = new TechCancelBtnMc;

And TechCancelBtnMc is defined in our theme gui swf. I did make sure they were using the same namespace. I also tried by using view.techView.TechCancelBtnMc in code and that still fails.

Also note that the swc files are in the libs folder at the root of the project, but arent showing, which i believe could make sense but seems odd.

Under my src folder i also have a fla folder containing a few different swf files which doesnt show anything in solution explorer.

Also, Project is targetting the Flex 3.6A framework.

Hoping i can get this issue resolved with your help.
Logged
Dermot
Administrator
Hero Member
*****
Posts: 1068


« Reply #1 on: August 03, 2013, 04:36:58 AM »

Hi,

I think the key is that the swf you are having problems with is a 'theme'. For some reason, the Flex/Flash compilers handle 'theme' swfs differently. You need to add a theme swf by using the command line option
Code:
-theme=mytheme.swf

You do this in Project Properties, select the Compiler tab, then look in Advanced. Under 'additional compiler arguments' put (my example):

Code:
-theme="C:\Flex SDKs\flex_sdk_4.6.0.23201B\frameworks\themes\Wireframe\wireframe.swc"

(don't forget the double quotes if the path has spaces in it).

See it that works.

I think we should have an option under the library properties (F4 to display) to indicate that it's a theme swf - that would be a better solution.

Dermot
Logged
digxstudios
Newbie
*
Posts: 20


« Reply #2 on: August 03, 2013, 11:29:33 AM »

We have a system where we run Visual Build 8.0 to automate the process of making our obfuscated release version.

part of its log, i can see the following command being issued.

"E:\Adobe\Adobe Flash Builder 4.6\FlashBuilderC.exe" --launcher.suppressErrors -noSplash -application org.eclipse.ant.core.antRunner -data "E:\Work\Client" -file "E:\Work\Client\AllianceWarfare\build.xml"

As you can see, its using FlashBuilderC.exe to do the compilation. Is there a way to see what it does under the hood so i can compare with what Anethyst uses ?

I tried to look for build logs in flash builder and couldnt find any.
Logged
digxstudios
Newbie
*
Posts: 20


« Reply #3 on: August 03, 2013, 12:57:13 PM »

I tried what you suggested and that didnt change a thing, still the same errors, only those referencing a movie clip in a SWC reference. I might have to resolve this one later but right now, compiler only complains about those movieclips.

I'm going to delete my solution and project files and try to re-import "in-place", the project.
Logged
Dermot
Administrator
Hero Member
*****
Posts: 1068


« Reply #4 on: August 03, 2013, 02:41:17 PM »

Can you post (or email) this file

Code:
-file "E:\Work\Client\AllianceWarfare\build.xml"

I think that contains the xml for the compiler.

Dermot
Logged
digxstudios
Newbie
*
Posts: 20


« Reply #5 on: August 03, 2013, 02:43:27 PM »

this is what gets generated.

<?xml version="1.0"?>
<flex-config xmlns="http://www.adobe.com/2006/flex-config">
<compiler>
<debug>true</debug>
<accessible>false</accessible>
<locale>
<locale-element>en_US</locale-element>
</locale>
<source-path>
<path-element>D:\Src\Flash\UIMain\AllianceWarfare\src</path-element>
</source-path>
<library-path>
<path-element>D:\Src\Flash\UIMain\AllianceWarfare\sdks\3.6.0\frameworks\libs\framework.swc</path-element>
<path-element>D:\Src\Flash\UIMain\AllianceWarfare\sdks\3.6.0\frameworks\libs\rpc.swc</path-element>
<path-element>D:\Src\Flash\UIMain\AllianceWarfare\libs\AWThemeGUI.swc</path-element>
<path-element>D:\Src\Flash\UIMain\AllianceWarfare\libs\CityView.swc</path-element>
<path-element>D:\Src\Flash\UIMain\AllianceWarfare\libs\map.swc</path-element>
<path-element>D:\Src\Flash\UIMain\AllianceWarfare\libs\TechView.swc</path-element>
<path-element>D:\Src\Flash\UIMain\AllianceWarfare\sdks\3.6.0\frameworks\locale\en_US</path-element>
</library-path>
<keep-generated-actionscript>true</keep-generated-actionscript>
<namespaces>
</namespaces>
<optimize>false</optimize>
<strict>true</strict>
</compiler>
<static-link-runtime-shared-libraries>true</static-link-runtime-shared-libraries>
<target-player>10.3.0</target-player>
<verify-digests>true</verify-digests>
</flex-config>
Logged
Dermot
Administrator
Hero Member
*****
Posts: 1068


« Reply #6 on: August 03, 2013, 03:44:42 PM »

OK. Amethyst creates a similar file. If you look in the VS Output/Build window pane you should see the command line that invokes the compiler - something like this:

Code:
"C:\Flex SDKs\flex_sdk_4.6.0.23201B\bin\mxmlc.exe" -incremental=true -load-config+="C:\Users\dermot\AppData\Local\SapphireSteel Software\Amethyst_2_10.0\Temp\ptv0uask\MXML3.xml" -output "C:\Data\Amethyst_2_Test\Scratch\Scratch1\bin\Debug\MXML3.swf" -- "C:\Data\Amethyst_2_Test\Scratch\Scratch1\src\MXML3.mxml"

Can you post the xml file so I can see what Amethyst is doing.

You will need to turn off the compiler service to see this - in Tools | Options |  Projects | Amethyst set 'Use Compiler Service' to false.

Dermot
Logged
digxstudios
Newbie
*
Posts: 20


« Reply #7 on: August 03, 2013, 04:23:07 PM »

I'd be willing to mail the file, for confidentiality reasons.

Where should i mail it ?
Logged
digxstudios
Newbie
*
Posts: 20


« Reply #8 on: August 03, 2013, 06:27:27 PM »

With the help of my flash coder, we ended up fixing the project so that it works correctly

so, first step was to get rid of that custom flex-config file we were using
second step, we moved some custom compiler vars into the Compiler->Configuration section of the project options
Then we found a faulty import in our code, not sure why it doesnt trigger an issue with flashbuilderc, maybe the references are set so it finds the source of that import.

After that, all went fine.

We are very impressed with the quality of Amethyst.

Thanks for all your help, it did help us figure out where issues could be.

I do have a few questions that come to my mind thought.

I see you provide a default obfuscator, are there any possibility to use a different one, like SecureSWF?

When i looked at the project file source, i was deceived to see full paths in there. Wouldnt relative path be a better solution for portability because when working with a team, there is no guarantee that all developers will put the files in the same exact path. For example, i personally put my projects under src/flash, but i know my flash coder doesnt use that kind of path, he's more of a different drive use, like X:\project.

We use Team Foundation Server 2012, and even if i havent tested it, i can tell Amethyst should integrate properly from a Source Control perspective, but i was wondering if this would allow us to use Continuous Integration and TFS Build Server, and what would be needed if it is possible. Would we need a license for each build system?

There is no doubt in my mind that Amethyst is a tool i want to see our small team adopt.

Logged
Dermot
Administrator
Hero Member
*****
Posts: 1068


« Reply #9 on: August 04, 2013, 05:15:59 AM »

That's good - glad you solved the problem!

Some answers ...

1) Obfuscator - yes you can use your own in a Post Build event (look under the Project Properties Build Events tab). Just put the commands in the you need to run the obfuscator.

2) There shouldn't be any absolute paths in the project file - but possibly the importer created those. You can replace any absolute paths with paths that are relative to the project base directory. You'll probably have to manually edit the project file to do this, though when you save any paths (having changed them in the project properties), Amethyst will try to save them as relative paths. If this isn't happening, it's a bug and we would like to know about it so we can fix it.

3) we use Team Server so that should work with no trouble, though we haven't upgraded to 2012 yet. You can use the TeamServer automated build system. There are two ways of doing this - the first is to use Visual Studio to drive the build (this is the easiest way). Essentially, you run Visual Studio from the command line with /build parameter (I think). The second way is more complex which is to use MSBuild directly to drive the build. To do this, you will have to copy the various Amethyst MSBuild tasks to your build server and use the Amethyst.targets file as the input of MSBuild. The Amethyst targets file is under 'C:\Program Files\MSBuild\SapphireSteel Software\Amethyst_2_10.0' or 'C:\Program Files\MSBuild\SapphireSteel Software\Amethyst_2_11.0' (for me). If you have a look at that, you'll see what needs to be done, though I think you would need to be fairly knowledgeable about MSBuild. We have done this in the past, but you do have to provide a number of parameters to MSBuild which the Visual Studio build provides automatically - for example, the project directory. We can give you more information on what's needed if you want to do this.

Dermot
Logged
digxstudios
Newbie
*
Posts: 20


« Reply #10 on: August 04, 2013, 11:21:18 AM »

Thank you for the quick response,

1) Yes, dont know why i didnt think of it, it does make sense.

2) I will make some tests and share my results with you

3) This was mostly a "can it be done" kind of question and i'm happing to know that it can. I won't be testing this for now but when we are ready, i might ask more questions.

Have one more question, what would be the best place or way to reports glitches and issues ?
Logged
Dermot
Administrator
Hero Member
*****
Posts: 1068


« Reply #11 on: August 04, 2013, 03:13:44 PM »

Bugs/Issues: best place is here if they are reasonably straightforward. If it gets complicated, we normally start a private e-mail conversation via our support email (or if you don't want to disclose things for commercial reasons). We put all bugs into our internal tracker system - we did have a public tracker system, but it proved more trouble than it was worth, so we discontinued it. The bugs fixed are then listed in the release notes for each new version or maintenance release.

Dermot
Logged
digxstudios
Newbie
*
Posts: 20


« Reply #12 on: August 04, 2013, 09:11:48 PM »

Regarding #2, you were right. I was probably looking at the generated project XML which has full paths in there and that confused me.

Apologies.
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!