小编ket*_*tan的帖子

深入了解Flex

你越了解自己在做什么,就越能做得更好.

我想深入了解Flex.我做了一些简单的事件处理,你越了解你在做什么,你做得越好.

我有一个大问题:

编译器做了什么?!MXML文件会发生什么?

假设我们有一个简单的代码(来自blogflexexamples的代码):

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/12/27/changing-the-flex-colorpicker-controls-swatch-panel-background-color/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="top"
        backgroundColor="white">

    <mx:Style>
        .myColorPicker {
            swatchPanelStyleName: myCustomSwatchPanelStyleName;
        }

        .myCustomSwatchPanelStyleName {
            backgroundColor: haloBlue;
        }
    </mx:Style>

    <mx:Script>
        <![CDATA[
            import mx.events.ColorPickerEvent;

            private function backgroundColor_change(evt:ColorPickerEvent):void {
                var cssObj:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".myCustomSwatchPanelStyleName");
                cssObj.setStyle("backgroundColor", evt.color);

                colorPicker.open();
            }
        ]]>
    </mx:Script>

    <mx:ApplicationControlBar dock="true">
        <mx:Form styleName="plain">
            <mx:FormItem label="backgroundColor:">
                <mx:ColorPicker change="backgroundColor_change(event);" />
            </mx:FormItem>
        </mx:Form>
    </mx:ApplicationControlBar>

    <mx:ColorPicker id="colorPicker"
            styleName="myColorPicker"
            editable="false" />

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

这会生成一个Actionscript文件吗?如果是这样的话:我能看到.as文件(就像C++中的预处理器一样)吗?

apache-flex flex3 actionscript-3

0
推荐指数
1
解决办法
219
查看次数

从Flash Builder 4创建Windows/Macintosh投影仪

我可以从Flash Builder 4发布Windows/Macintosh投影仪吗?我想要一个保留在IDE中的解决方案,而不是必须打开FlashPlayer.exe并导出EXE/App.

apache-flex actionscript-3 flash-builder

0
推荐指数
1
解决办法
3070
查看次数

双数字返回stackoverflow

double我想,可以代表的最高数字是非常高的.虽然以下代码抛出异常.这实际上是我的完整代码.

public class Summe {
public static void main(String[] args) {
    System.out.println(summe(20000));
  }

public static double summe(double s) {
    return s == 0 ? s : s + summe(s-1); 
  }
}
Run Code Online (Sandbox Code Playgroud)

谢谢你到目前为止的答案.我的问题是:我如何使我的代码工作?

java stack-overflow double function

0
推荐指数
1
解决办法
69
查看次数

JNA通过引用dll传递字符串,但不返回

嗨,我对Java和DLL有问题。

我需要通过引用将字符串值传递给dll,但是,它不成功。

public short ReadData(int block_id, int offset, int data_size,StringByReference dataBuf, IntByReference err_code);
Run Code Online (Sandbox Code Playgroud)

问题是StringByReference dataBuf,我尝试了多种方法来找到解决方案,但是它不起作用。

调用函数为:

ReadData(0, 4, 13, ??? , status);
Run Code Online (Sandbox Code Playgroud)

原因没有.dll文件。

功能

`public static short Read_Data(int card_type, int block_id, int offset, int data_size, String dataBuf, IntByReference err_code){
        short rc;
        IntByReference status = new IntByReference(0);
         int len = data_size+16;
        //StringByReference dataBuf_ref =  new StringByReference( spaces(data_size+16));
        //StringBuilder zText = new StringBuilder ();
        //zText.append(dataBuf);
        dataBuf = spaces(data_size+16);
        //StringByReference a = new StringByReference(dataBuf);
    //  StringByReference a = new StringByReference(dataBuf);

    //Pointer …
Run Code Online (Sandbox Code Playgroud)

java dll reference jna

0
推荐指数
1
解决办法
2340
查看次数

在React中找不到模块

我是React的新手.我使用以下命令创建了新的react应用程序.

create-react-app app-name --scripts-version custom-react-scripts-version
Run Code Online (Sandbox Code Playgroud)

在该应用程序的内部src文件夹中,我创建了2个新文件夹,例如GridTitle,并在受尊重的文件夹中创建了Grid.js和Title.js文件.

Grid.js

import React from 'React';

export default class Grid extends React.Component {
    render() {
        return (
            <div>
                <h1>Grid</h1>
            </div>
        );
    }
}
Run Code Online (Sandbox Code Playgroud)

Title.js

import React from 'React';

const Title = () =>  {
    return (
        <div>
            <h1>Title</h1>
        </div>
    );
}

export default Title;
Run Code Online (Sandbox Code Playgroud)

现在,我尝试将两者都导入到App.js文件中,但它不会.

import Title from './Title/Title';
import Grid from './Grid/Grid';
Run Code Online (Sandbox Code Playgroud)

它显示以下错误.

编译失败.

./src/Grid/Grid.js找不到模块:D:\ReactAppCSS\node_modules\React\index.js与磁盘上的相应路径不匹配react.

Title.js也是如此.

任何帮助将非常感谢.

javascript reactjs

0
推荐指数
1
解决办法
579
查看次数

我可以使用 HTML 元素作为对象键吗?

我正在尝试创建一个以 HTML 元素为键的对象。我使用创建键document.createElement('div'),但是当我尝试将两个键都插入到对象中时,第二个键最终替换了第一个:

let a = document.createElement('div');
let b = document.createElement('div');

let obj = {};
obj[a] = 3;
obj[b] = 'x';

console.log(obj);
Run Code Online (Sandbox Code Playgroud)

有没有办法在不替换任何键或值的情况下做到这一点?

html javascript dom dictionary object

0
推荐指数
1
解决办法
193
查看次数

在圆圈内打勾

我正在尝试在实心圆圈内创建刻度线。

我做了以下,但看起来并不完美。

<svg height=10 viewBox="0 0 10 10" width=10>
    <g fill="none" stroke="#22AE73" stroke-width="1"></g>
    <circle cx=5 cy=5 fill='#29AB87' r=5 />
    <polyline stroke="#ffffff" stroke-width="2" points="2.5,5.8 4.7,7.9 9.2,2.4 " />
</svg>
Run Code Online (Sandbox Code Playgroud)

任何帮助将不胜感激。

html svg

-1
推荐指数
1
解决办法
93
查看次数

在Java中反转一个int数组

我已经编写了以下代码来反转int数组,但是,我看不到结果正确。有什么暗示吗?谢谢!

结果是

[I@15db9742[I@15db9742[I@15db9742[I@15db9742[I@15db9742[I@15db9742[I@15db9742[I@
Run Code Online (Sandbox Code Playgroud)

这似乎很奇怪。

public class reverseArray {
public static void main(String[] args) {
    int[] array = {2, 4, 5, 7, 8, 9, 12, 14, 17, 19, 22, 25, 27, 28, 33, 37};
    reverse(array, 0, array.length - 1);
}

public static void reverse(int[] data, int low, int high) {

    if (low < high) {
        int temp = data[low];
        data[low] = data[high];
        data[high] = temp;
        reverse(data, low + 1, high - 1);
    }
    System.out.print(data);
 }
}
Run Code Online (Sandbox Code Playgroud)

java arrays

-2
推荐指数
1
解决办法
1691
查看次数