首页 \ 问答 \ Flex 4.5.1在新应用程序上添加一个简单的Bitmap或Sprite?(Flex 4.5.1 Add a simple Bitmap or Sprite on new application?)

Flex 4.5.1在新应用程序上添加一个简单的Bitmap或Sprite?(Flex 4.5.1 Add a simple Bitmap or Sprite on new application?)

也许这是一个坏习惯,我自从Flash Professional以来仍然有,但我试图添加一个简单的Sprite或/和我刚创建的Bitmap到一个空的应用程序,它没有发生。

<?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" 
               xmlns:mx="library://ns.adobe.com/flex/mx" 
               minWidth="955" minHeight="600" 
               creationComplete="application1_creationCompleteHandler(event)">

    <fx:Script>
        <![CDATA[
            import mx.core.FlexGlobals;
            import mx.core.UIComponent;
            import mx.events.FlexEvent; 


            protected function application1_creationCompleteHandler( event : FlexEvent ) : void
            {
                var s:Sprite = new Sprite();
                s.graphics.beginFill( 0xFF0000, 0.5 );
                s.graphics.drawRect( 0, 0, 100, 100 );
                s.graphics.endFill();

                this.addChild( s );
            }

        ]]>
    </fx:Script>
</s:Application>

有人能告诉我我做错了什么并帮我纠正吗?


Maybe it is a bad habit which I still have since Flash Professional, but I'm trying to add a simple Sprite or/and Bitmap I just created to an empty Application and it's not happening.

<?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" 
               xmlns:mx="library://ns.adobe.com/flex/mx" 
               minWidth="955" minHeight="600" 
               creationComplete="application1_creationCompleteHandler(event)">

    <fx:Script>
        <![CDATA[
            import mx.core.FlexGlobals;
            import mx.core.UIComponent;
            import mx.events.FlexEvent; 


            protected function application1_creationCompleteHandler( event : FlexEvent ) : void
            {
                var s:Sprite = new Sprite();
                s.graphics.beginFill( 0xFF0000, 0.5 );
                s.graphics.drawRect( 0, 0, 100, 100 );
                s.graphics.endFill();

                this.addChild( s );
            }

        ]]>
    </fx:Script>
</s:Application>

Could someone tell me what I am doing wrong and help me correct it?


原文:https://stackoverflow.com/questions/6493564
更新时间:2023-10-24 09:10

最满意答案

升级到1.10.12(数据表)解决了这个问题。

//cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js

我还必须将过滤器更新为自定义过滤器,而不是像我在我的问题中那样内联。

  //Initial Value
$scope.filterTag = "TYPE 1";

$scope.dtInstance = {};

  $scope.filteredData = $scope.items.filter(function(r) {
    var tag = (typeof $scope.filterTag === undefined)? "TYPE 1"  : $scope.filterTag;
    var show = r.TagName == tag;
    return show;
});



 var update = function(){
  $scope.filteredData = $scope.items.filter(function(r) {
     var tag = (typeof $scope.filterTag === undefined)? "TYPE 1"  : $scope.filterTag;
    var show = r.TagName == tag;
    return show;
});
}

工作示例

https://plnkr.co/edit/NI6ixwlUT82s1MpBvMRg?p=preview


An upgrade to 1.10.12 (datatables) fixed the issue.

//cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js

I also had to update the filter to be a custom filter instead of inline as I had in my question.

  //Initial Value
$scope.filterTag = "TYPE 1";

$scope.dtInstance = {};

  $scope.filteredData = $scope.items.filter(function(r) {
    var tag = (typeof $scope.filterTag === undefined)? "TYPE 1"  : $scope.filterTag;
    var show = r.TagName == tag;
    return show;
});



 var update = function(){
  $scope.filteredData = $scope.items.filter(function(r) {
     var tag = (typeof $scope.filterTag === undefined)? "TYPE 1"  : $scope.filterTag;
    var show = r.TagName == tag;
    return show;
});
}

Working example

https://plnkr.co/edit/NI6ixwlUT82s1MpBvMRg?p=preview

相关问答

更多