从Flex 3.6迁移到4.6 [英] migrating from Flex 3.6 to 4.6

查看:76
本文介绍了从Flex 3.6迁移到4.6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用Flex 3.6创建一个Adobe Flex Air项目!但是现在它应该成为iPad的App,但是Flash Builder自Flex 4.6起只能将项目导出为App.因此,我想将项目从Flex 3.6转换为4.6,这应该很容易做到,但是库和/或名称空间存在一些问题,这使我感到困惑.这是我的Main-mxml的启动方式:

I'm currently working on an Adobe Flex Air Project, which was created with Flex 3.6! But now it should become an App for IPad, but Flash Builder can only export projects as App since Flex 4.6. So I'm trying to convert the project from Flex 3.6 to 4.6, what should be easy to do, I guess, but there are some problems with libraries and/or namespaces, which confuse me. This is how my Main-mxml starts:

<s:Application xmlns:mx="http://ns.adobe.com/mxml/2009" 
           xmlns:mx="library://ns.adobe.com/flex/mx" 
           xmlns:s="library://ns.adobe.com/flex/spark"
           xmlns:MyComp="*"
           xmlns:local="*"
           xmlns:srv="generated.webservices.*"
           width="1366"
           applicationComplete="init()"
           backgroundGradientColors="[0xffffff,0xffffff]"
           borderColor="#ffffff"
           color="#eaeaea"
           fontSize="14"
           horizontalScrollPolicy="off"
           layout="absolute"
           paddingBottom="0"
           paddingLeft="0"
           paddingRight="0"
           paddingTop="0"
           verticalScrollPolicy="off">

但是我得到了错误:

`Attribute "mx" bound to namespace "http://www.w3.org/2000/xmlns/" was already specified for element "s:Application".`

但是如果我删除该行

`xmlns:mx="library://ns.adobe.com/flex/mx"`

那我当然不能用mx:VBox了,将不得不重构整个项目.

then of course I can't use e.g. mx:VBox any more and would have to refactor the whole project.

例如,我使用Flex 4.6尝试了一些测试示例.

I tried some test examples using Flex 4.6, e.g.

<?xml version="1.0"?>
<!-- containers\layouts\BoxSimple.mxml -->
<s:Application 
    xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:mx="library://ns.adobe.com/flex/mx" 
    xmlns:s="library://ns.adobe.com/flex/spark">

    <mx:Box direction="vertical" 
            borderStyle="solid" 
            paddingTop="10" 
            paddingBottom="10" 
            paddingLeft="10" 
            paddingRight="10">

        <mx:Button id="fname" label="Button 1"/>
        <mx:Button id="lname" label="Button 2"/>
        <mx:Button id="addr1" label="Button 3"/>
        <mx:ComboBox id="state">
            <mx:ArrayList>
                <fx:String>ComboBox 1</fx:String>
            </mx:ArrayList>
        </mx:ComboBox>
    </mx:Box>
</s:Application>

但是在这里我得到了错误

But here I get the error

    `"Could not resolve <mx:Button> to a component implementation." `and more like this.

现在我的问题是: 1.可以使用所有三个名称空间

Now my question(s): 1. It's possible to use all three namespaces

 `(xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:mx="library://ns.adobe.com/flex/mx" 
    xmlns:s="library://ns.adobe.com/flex/spark")`

对吗?我在互联网上的几个示例中都看到了这一点,因此我认为它必须可以工作.

Right? I saw this on several examples on the internet so I think it must work.

  1. 我是否必须引用/添加外部库才能将Flex 4.6与这3个命名空间一起使用?
  2. 是否存在从Flex 3.6迁移到4.6的简便方法?即使在3.6中进行了开发,还是有必要进行更改还是必须在4.6中工作?

此外,我对Flex还是比较陌生的,尽管我认为这并不难.

Besides, I'm relatively new to Flex, though it's not difficult I think.

预先感谢

此致

最大B

推荐答案

Max-专门回答您的问题,绝对有可能在Flex 4应用程序中使用MX组件.您的示例似乎可以与常规的Flex 4.6项目一起很好地工作.您可能需要确保您具有正确的库路径设置.

Max - to answer your question specifically it is absolutely possible to use MX components within Flex 4 apps. Your example seems to work fine with a regular flex 4.6 project. You might need to ensure you have the right library path settings.

这篇关于从Flex 3.6迁移到4.6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆