Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/flash/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flash Flex使用不带摄像头的摄像头_Flash_Actionscript 3_Apache Flex_Camera_Flash Builder4.5 - Fatal编程技术网

Flash Flex使用不带摄像头的摄像头

Flash Flex使用不带摄像头的摄像头,flash,actionscript-3,apache-flex,camera,flash-builder4.5,Flash,Actionscript 3,Apache Flex,Camera,Flash Builder4.5,关于我申请的另一个问题。因此,当用户注册时,他需要拍照。我想在不使用相机的情况下进行此操作。我遵循了某种教程,但应用程序没有运行。我没有发现错误,但相机没有显示。以下是我所做的: <?xml version="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"

关于我申请的另一个问题。因此,当用户注册时,他需要拍照。我想在不使用相机的情况下进行此操作。我遵循了某种教程,但应用程序没有运行。我没有发现错误,但相机没有显示。以下是我所做的:

    <?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
        xmlns:s="library://ns.adobe.com/flex/spark" 
        xmlns:mx="library://ns.adobe.com/flex/mx"
        activate="view1_activateHandler(event)"
        title="Camera Test">
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>


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

            import spark.components.Image;
            import spark.components.VideoDisplay;
            import spark.components.ViewNavigator;

            private var cam:Camera;
            private var video:Video;
            private var uic:UIComponent;

            protected function cameraButton_clickHandler(event:MouseEvent):void
            {
                if(!cam){
                    trace("whut");
                    cameragroup.removeAllElements();
                    this.cam=Camera.getCamera();
                    cam.setQuality(0,100);

                    cam.setMode(cameragroup.width, cameragroup.height, 30, false);
                    if(cam){
                        trace("camera added");
                        this.video=new Video(cameragroup.width, cameragroup.height);

                        video.attachCamera(cam);

                        this.uic=new UIComponent();
                        uic.addChild(video);

                        var m:Matrix=new Matrix();
                        m.rotate(Math.PI/2);
                        video.transform.matrix=m;

                        var m2:Matrix = new Matrix();
                        m2.translate((video.width+cameragroup.width/4)-this.frame.x, 5);
                        uic.transform.matrix=m2;

                        cameragroup.addElement(uic);
                        cameraButton.label="shoot";
                    }
                }
            }

            protected function view1_activateHandler(event:Event):void
            {
                this.cameraButton.label="shoot";
            }

        ]]>
    </fx:Script>

    <s:VGroup width="100%" height="100%" horizontalAlign="center" paddingBottom="30" paddingLeft="10" paddingRight="10" paddingTop="30">
        <s:Group id="frame" width="100%" height="100%">
            <s:Rect width="100%" height="100%">
                <s:fill>
                    <s:SolidColor color="0x000000" alpha="0.2"/>
                </s:fill>
            </s:Rect>
            <s:Group id="cameragroup" width="210" height="220"/>
        </s:Group>

        <s:Spacer height="100%"/>
        <s:HGroup width="100%" horizontalAlign="center">
            <s:Button id="cameraButton" width="50%" height="80" label="start" click="cameraButton_clickHandler(event)"/>
        </s:HGroup>
    </s:VGroup>
</s:View>

这是完整的.mxml文件。我一行一行地忽略了代码,但没有发现任何错误


Grtz

在您的Application-app.xml中

确保有以下内容

<uses-permission android:name="string" />

就我们而言:

<uses-permission android:name="android.permission.CAMERA"/>

这里将更详细地解释这一点:

在Application-app.xml中

确保有以下内容

<uses-permission android:name="string" />

就我们而言:

<uses-permission android:name="android.permission.CAMERA"/>

这里将更详细地解释这一点:

权限?(至少15个字符)在MyAWESOME-app.xml中,谢谢!我花了一整晚的时间来寻找!:)基于另一个SO问题测试其他Flex mobile问题没有问题,我想既然你说你逐行检查了代码,那么它必须是你正在查看的文件之外的东西。我有多少次对你们说过,当你们消除了不可能,剩下的无论多么不可能,都一定是真相-亚瑟·柯南·道尔的《福尔摩斯》许可证?(至少15个字符)在MyAWESOME-app.xml中,谢谢!我花了一整晚的时间来寻找!:)基于另一个SO问题测试其他Flex mobile问题没有问题,我想既然你说你逐行检查了代码,那么它必须是你正在查看的文件之外的东西。我有多少次对你们说过,当你们消除了不可能,剩下的无论多么不可能,都一定是真相-亚瑟·柯南·道尔《福尔摩斯》