2010-08-07 58 views
1

基本上,無論我對源代碼所做的更改如何,總是編譯時會產生代碼轉換錯誤或缺少定義。MinimalComps Flash GUI和代碼轉換錯誤

我是新來的閃光燈,所以我很難理解如何去解決這個問題。

無論如何這裏是來源。

堆棧溢出鏈接我總是在全部我的來源,每當我感覺我的頭撞在鍵盤上看着鼓勵。

// Main.as 
package 
{ 
// General imports 
// http://stackoverflow.com/questions/564756/should-i-just-give-up-on-programming 
import com.bit101.components.Label; 
import flash.display.*; 
import flash.events.*; 
import AssetManager; 

// Begin external facing class 
public class Main extends Sprite 
{ 
    public function Main() 
    { 
    var globalFont:String = AssetManager.FONT_PFRONDA; 
    //var myLabel:com.bit101.components.Label = new Label(Main = null, xpos = 25, ypos = 30, text = "Test Successfull"); 
     //addChild(myLabel); 
    } 
} 


--- 

// AssetManager.as 
package 
{ 
public class AssetManager 
{ 
     [Embed(source = 'C:\\Documents and Settings\\Geko\\Desktop\\Flash\\testclient\\lib\\MinimalComps_0_9_5_\\src\\assets\\pf_ronda_seven.ttf', fontName = 'PF Ronda Seven', fontWeight = 'normal', advancedAntiAliasing = 'true', mimeType = 'application/x-font-truetype')] public static const FONT_PFRONDA:String; 
} 

} 

目前,當我嘗試編譯我收到以下錯誤......

C:\Documents and Settings\Geko\Desktop\Flash\testclient\src\Main.as(6): col: 31 
Error: Definition com.bit101.components:Label could not be found. 

,如果我刪除「VAR myLabel」或主「的addChild線」的評論。因爲,然後我得到..

C:\Documents and Settings\Geko\Desktop\Flash\testclient\lib\MinimalComps_0_9_5_\src\com\bit101\components\Component.as(51): col: 4: Error: transcoding parameter 'embedAsCFF' is not supported by 'flex2.compiler.media.FontTranscoder' 

C:\Documents and Settings\Geko\Desktop\Flash\testclient\lib\MinimalComps_0_9_5_\src\com\bit101\components\Component.as(51): col: 4: Error: Unable to transcode /assets/pf_ronda_seven.ttf. 

我的類路徑是 「SRC」, 「LIB \ MinimalComps_0_9_5_的\ src \資產」 和 「LIB \ MinimalComps_0_9_5_的\ src \ COM \ bit101 \組件」

我使用的Flex SDK 3.5.0.12683在Windows XP上使用的FlashDevelop 3.2.1 RTM

任何想法,爲什麼我不斷收到錯誤每次我嘗試建立這個項目?

回答

0
 
C:\Documents and Settings\Geko\Desktop\Flash\testclient\src\Main.as(6): col: 31 Error: Definition com.bit101.components:Label could not be found. 

這將表明應用程序無法找到標籤類,可能的原因可能是您的類問題庫路徑,而不是導入標籤類,用Label類包的名稱等問題...

另外兩個錯誤與您的字體嵌入方式有關。 「embedAsCFF」需要Flex SDK 4.

在錯誤消息中,您會提到flex2編譯器。

'flex2.compiler.media.FontTranscoder' 

您確定要使用Flex SDK 3.5嗎?我自己不使用FlashDevelop,所以我不知道在哪裏查看才能編輯當前的Flex SDK。

+0

雖然這並沒有解決我所有的錯誤,但它幫助我做出瞭解決方案所必需的心理跳躍。 我的項目的導入語句和文件夾結構不正確。 「embedasCFF」錯誤是由label.as中的兩行引起的,第一行是針對Flex SDK 4的,並沒有對其進行評論,而第二行是針對Flex SDK 3並被註釋掉的。我剛剛評論了Flex SDK4產品線,並從Flex SDK3產品線中刪除了評論。 另外,我意識到我不需要在調用構造函數時輸入參數的實際名稱。 感謝您的幫助Wopdoowop。 – James 2010-08-08 18:59:03

+0

我通常更喜歡當我找到一個解決方案後,我自己的問題有人讓我在正確的方向。我很高興能幫上忙! – PatrickS 2010-08-09 01:07:18