标签: apache-flex

有没有办法将另一个类的成员函数作为参数传递给as3中的函数?

例如,我在A类中有一个函数:

    private function functionA(f:Function):void
    {
        var objB:B;
        objB.f();
    }
Run Code Online (Sandbox Code Playgroud)

有没有办法将类B的非静态公共成员函数作为参数传递给functionA?(当然,来自A类内部)我知道c ++中存在这样的语法,但不确定你是否可以在flex/as3中执行此操作

apache-flex actionscript flex3 actionscript-3

3
推荐指数
1
解决办法
229
查看次数

如何使用弹簧安全性保护混合Spring MVC + Flex应用程序

我试过在Spring论坛上问这个问题(http://forum.springsource.org/showthread.php?109948-Problem-configuring-spring-security-3.1-with-hybrid-Spring-MVC-Flex-application)但是没有得到回应.

我正在开发一个Web应用程序,它具有内置Flex的(最终用户)用户界面和使用Spring MVC构建的管理用户界面.我正在尝试保护两个接口,并且可以让每个接口单独工作,但不能一起工作.

我正在使用带有Spring Security 3.1RC1和Spring 3.1M1的spring-flex-core 1.5.0的快照构建

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:security="http://www.springframework.org/schema/security"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd">

<!-- All Spring Security related configuration goes here -->

<security:global-method-security secured-annotations="enabled" jsr250-annotations="enabled"/>

<security:http pattern="/messagebroker/**" entry-point-ref="entryPoint">
    <security:anonymous enabled="false"/>
</security:http>

<bean id="entryPoint" class="org.springframework.flex.security3.FlexAuthenticationEntryPoint"/>

<security:http pattern="/favicon.ico" security="none"/>
<security:http pattern="/login*" security="none"/>
<security:http pattern="/logoutSuccess*" security="none"/>
<security:http pattern="/apollo/css/**" security="none"/>
<security:http pattern="/apollo/js/**" security="none"/>
<security:http pattern="/apollo/img/**" security="none"/>
<security:http pattern="/common/css/**" security="none"/>
<security:http pattern="/common/js/**" security="none"/>
<security:http pattern="/common/img/**" security="none"/>
<security:http pattern="/MoneyManager.swf" security="none"/>
<security:http pattern="/assets/**" security="none"/>
<security:http pattern="/index.jsp" security="none"/>

<security:http servlet-api-provision="true"> …
Run Code Online (Sandbox Code Playgroud)

java apache-flex spring-mvc spring-security

3
推荐指数
1
解决办法
2606
查看次数

何时在as3中使用ArrayCollection或Array?

我知道a ArrayCollection是一个包装器Array,但我想知道的是何时选择一个而不是另一个?过度使用ArrayCollections会导致性能下降吗?

apache-flex arrays flex3 actionscript-3 arraycollection

3
推荐指数
1
解决办法
1599
查看次数

构建没有Flash Builder的ActionScript 3.0应用程序

我有一个使用Adobe Flash Builder 4.5试用版制作的Actionscript 3.0应用程序.

现在,Flash Builder许可证已过期.

有没有办法在不使用Flash Builder的情况下编译我的代码?

我在某处读到有一个免费的编译器来做到这一点.Flex怎么样?免费?也许我可以在Flex中使用我的动作代码

apache-flex flash actionscript-3 flash-builder flex4

3
推荐指数
1
解决办法
2083
查看次数

如何在Adobe Flex/AIR应用程序中存储用户首选项

在Flex的Flex应用程序中存储用户首选项的标准方法是什么?我需要存储简单的参数,如最近打开的文件列表,窗口位置和大小等.

apache-flex air

3
推荐指数
2
解决办法
4923
查看次数

Flex 4 App Blank

我正在构建一个Flex 4应用程序(使用flexmojos而不是FlexBuilder).如果我使用mx:Application创建一个测试应用程序,那么我会看到一个按钮,如我所料:

<mx:Application
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="http://www.adobe.com/2006/mxml">

    <s:Button
        label="Button"/>

</mx:Application>
Run Code Online (Sandbox Code Playgroud)

但是,如果我使用s:应用程序,那么我看到的只是一个空白(白色)屏幕:

<s:Application
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="http://www.adobe.com/2006/mxml">

    <s:Button
        label="Button"/>

</s:Application>
Run Code Online (Sandbox Code Playgroud)

顺便说一句,我目前没有使用html包装器,我只是直接在浏览器中加载swf.

这是我的pom ......

<project 
    xmlns="http://maven.apache.org/POM/4.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.aaa.bbb</groupId>
    <artifactId>app</artifactId>
    <packaging>war</packaging>
    <version>2.0-SNAPSHOT-1</version>
    <name>app</name>
    <url>http://maven.apache.org</url>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <sourceDirectory>src/main/flex</sourceDirectory>
        <testSourceDirectory>src/test/flex</testSourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.sonatype.flexmojos</groupId>
                <artifactId>flexmojos-maven-plugin</artifactId>
                <version>3.9</version>
                <dependencies>
                    <dependency>
                        <groupId>com.adobe.flex</groupId>
                        <artifactId>compiler</artifactId>
                        <version>4.5.0.20967</version>
                        <type>pom</type>
                    </dependency>
                </dependencies>
                <extensions>true</extensions>
                <configuration>
                    <policyFileUrls>
                        <url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</url>
                    </policyFileUrls>
                    <rslUrls>
                        <url>http://fpdownload.adobe.com/pub/{extension}/flex/4.5.0.20967/{artifactId}_{version}.{extension}</url>
                    </rslUrls>
                </configuration>
                <executions>
                    <execution>
                        <id>flex-compile</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile-swf</goal>
                        </goals>
                        <configuration>
                            <output>src/main/webapp/Main.swf</output>
                        </configuration>                        
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
          <groupId>com.adobe.flex.framework</groupId>
          <artifactId>textLayout</artifactId>
          <version>4.5.0.20967</version>
          <type>swc</type>
          <scope>compile</scope> …
Run Code Online (Sandbox Code Playgroud)

apache-flex flexmojos flex4 maven

3
推荐指数
1
解决办法
2830
查看次数

编译器警告我,绑定不起作用,但为什么我运行它确实有效的应用程序!

下面的Flex应用程序生成编译器警告:数据绑定将无法检测到'dp'的分配.这似乎是正确的,因为变量'dp'不是可绑定属性(没有[Bindable]元数据标记).我添加了一个按钮,当点击它时,它会将项目附加到'dp'的后面.虽然编译器警告我不会看到'dp'的更改,但每次单击按钮时列表都会显示新项目!

我不明白为什么我可以在列表中看到新项目.有人可以解释为什么这仍然有效虽然'dp'不可绑定吗?

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" minWidth="955" minHeight="600">
<mx:Script>
    <![CDATA[
        import mx.collections.ArrayCollection;
        import mx.rpc.events.ResultEvent;

        private var arrayData:Array = [
            {name:"banana", cat:"fruit", cost:0.99},
            {name:"bread", cat:"bakery", cost:1.99},
            {name:"orange", cat:"fruit", cost:0.52},
            {name:"donut", cat:"bakery", cost:0.33},
            {name:"apple", cat:"fruit", cost:1.05}];

        private var dp:ArrayCollection = new ArrayCollection(arrayData);

        private function onButtonClick(event:MouseEvent):void
        {
            var obj:Object = new Object();
            obj.name="test";
            obj.cat="testcat";
            obj.cost=666;
            dp.addItem(obj);
        }
    ]]>
</mx:Script>        
<mx:HorizontalList dataProvider="{dp}" labelField="name" columnWidth="100" width="80%" height="50"/>
<mx:Button label="Click me" click="onButtonClick(event)" /> 
Run Code Online (Sandbox Code Playgroud)

apache-flex adobe actionscript

3
推荐指数
1
解决办法
963
查看次数

flex 4.5简单的火花按钮剥皮

有人错过了为简单按钮设置皮肤的简单方法吗?

<mx:Button x="10" y="10" label=""
           upSkin="@Embed('imgs/mainButton_std.png')"
           overSkin="@Embed('imgs/mainButton_over.png')"
           downSkin="@Embed('imgs/mainButton_over.png')"
           disabledSkin="@Embed('imgs/mainButton_std.png')"
           creationComplete="mainButtonHitArea()"
           width="75" height="75" id="menuButton" enabled="true"/>
//mainButtonHitArea() : Is a generic function that generates the hit area
Run Code Online (Sandbox Code Playgroud)

我遇到的问题是,这种创建带皮肤的简单按钮的方法正在逐步淘汰:事实上,Flex 4.5移动项目不再支持它.

所以问题是:是否有一种简单的方法来执行此操作,使用火花按钮(这被认为是新的方式).尽可能简单.

基本上我只需要一个带有2个图像的按钮:向下/向上和向上.我想让代码保持尽可能简单:新的蒙皮方法似乎真的为以前的例子提供了过多的线条.

apache-flex button actionscript-3 flex4 flex4.5

3
推荐指数
3
解决办法
1万
查看次数

默认属性的多个初始化值,'spark.core.IViewport'类型的'viewport'

拜托,任何人都可以帮我解决这个问题:下面的代码片段工作正常,直到我决定添加一个滚动条以获得更好的视图,突然间,我得到错误:

"Multiple initializer values for default property, 'viewport' of type 'spark.core.IViewport'"
Run Code Online (Sandbox Code Playgroud)

谢谢

[CODE]

  <s:Scroller
    width="100%"
    height="100%"
    >

<s:Group id="basicDataGroup" includeIn="initial">

    <s:HGroup id="buttonGroup" 
              x="250" 
              paddingTop="20" 
              gap="15">
        <s:Button id="addBT" label="{resourceManager.getString('aggregationUI','add')}" click="addBT_clickHandler(event)"/>
        <s:Button id="delBT" label="{resourceManager.getString('aggregationUI','delete')}"/>
    </s:HGroup>

    <s:DropDownList id="languageCombo" 
                    prompt="{resourceManager.getString('aggregationUI','lang')}"
                    dataProvider="{new ArrayCollection([{locale:'fr_FI',label:'France'}, {locale:'en_US', label:'English'}])}"
                    change="languageChange(event)" 
                    width="100" 
                    x="473" 
                    y="20"/>

    <components:SearchComponent id="searchModel" searchClick="searchModel_searchClickHandler(event)"/>

    <components:DataComponent id="basicData" 
                              x="250" 
                              y="50"/>
</s:Group>

<s:Group id="newModelGroup" includeIn="newModel">
    <components:NewDataComponent id="newModelData"/>
    </s:Group>
</s:Scroller>
[/CODE]
Run Code Online (Sandbox Code Playgroud)

apache-flex actionscript-3 flex4.5

3
推荐指数
1
解决办法
2953
查看次数

Flash/ActionScript 3中是运算符的性能?

任何人都有关于is运算符性能的文章/测试?我在谷歌上找不到任何东西,只是把我的"是"关键字当作太小了.

我计划在我的组件的消息传递系统中广泛使用is运算符,因此性能需要稳固.如果我可以这样做,它将使我不必为每条消息提出一个id和id-lookups方案:

function onMessage(message : Message, type : Class) : void
{
    switch(type)
    {
        case MessageOne:
            // whatever
        break;
        case MessageTwo:
            // whatever
        break;
    }
}
Run Code Online (Sandbox Code Playgroud)

我完成的时序测试表明它几乎和整数比较一样快,所以我只是想确定一下.

有人做过自己的测试或知道一些文章吗?

谢谢.

apache-flex air flash actionscript actionscript-3

3
推荐指数
1
解决办法
1129
查看次数