0
votes

I am working on a Flash Mobile project in Flash Builder 4.7. I am getting 4 "Flex Problem" errors when embedding the source of a spark SWFLoader object in the MXML. The errors I get occur in a range of Flex SDKs, from 4.6 to 4.14. For years I have not had a problem doing such an embed, but recently this began to crop up. Similar code works on a coworkers computer, despite everything about our setups seemingly identical. To troubleshoot this error, I created a new Flex Mobile project, with the only code in the MXML being:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark">

    <s:SWFLoader source="@Embed(source='Logo.swf')"/>

</s:Application>

The errors I get are:

1084: Syntax error: expecting rightbrace before end of program. line 29
1084: Syntax error: expecting rightbrace before stream. line 25
1084: Syntax error: expecting rightparen before s. line 25
1094: Syntax error: A string literal must be terminated before the line break. line 25

There is no Path given for the errors. My project clearly has no line 25 or 29, so I don't know where this error could even be occurring.

The 'Logo.swf' file is in the right location. It is just a vector graphic with no action script code in it.

EDIT: The source of the problem appears to be the very nature of embedding a SWF, even external to SWFLoader. The below MXML code, with a script embed in place of the SWFLoader embed, gives the same 4 errors as the previous:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark">

    <fx:Script>
        <![CDATA[
            [Embed(source="Logo.swf")]
            [Bindable]
            public var swfCls:Class;
        ]]>
    </fx:Script>

</s:Application>
1
There must be more involved somewhere. - BadFeelingAboutThis
I agree, which is the kind of suggestions that I am looking for. The only files in this project are 'Test.xmxml', 'Test-app.xml', and 'Logo.swf'. No action script written by me. - MMPGreg
i suggest that you verify your project build path librairies, your sdk version - Jileni Bouguima
I discovered the same issue when embedding a SWF through script, see EDIT to the original post. - MMPGreg
if your remove everything and add just a button, is the problem persist ? - Jileni Bouguima

1 Answers

0
votes

While not a complete solution, I found a workaround to the problem. It appears that once a workspace has this bug, it stays there. Any new projects created within it will have this bug.

My solution was to create a new workspace, create a new dummy project with an embedded SWF which DID work, and then import a previous project which had been having the error into this new workspace. Alas, the old program's bug disappeared. Apparently, if the workspace already has a working program in it, anything subsequent should not have the problem.