Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 945619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:46:51+00:00 2026-05-15T22:46:51+00:00

I am a total Flash newbie. I just installed Flash CS5 and wrote the

  • 0

I am a total Flash newbie. I just installed Flash CS5 and wrote the following code:

import flash.display.BitmapData
import flash.geom.Matrix
import com.adobe.images.JPGEncoder;
import flash.net.FileReference;
import flash.utils.ByteArray;

//get the default camera
//change your Default camera using the Flash Player Settings.
cam=Camera.get()
//this event is called whenever permission to access the local camera, is accepted or denied by the user
cam.onStatus=function(e)
{
    //if we are given permission
    if(e.code == "Camera.Unmuted")
    {
        //start the application
        initialize()
    }
    else
    {
        System.showSettings(3)
    }
}

var snapshot:BitmapData=new BitmapData(cam.width,cam.height);

function takeSnapshot()
{   
    var i:Number=1;
    var fileRef:FileReference = new FileReference();
    snapshot.draw(cam,new Matrix());
    //saveImage();
     var encoder:JPGEncoder = new JPGEncoder();
     var ba:ByteArray = encoder.encode(bitmapData);
     fileRef.save(ba,"capture"+i+".jpg");
     i++;
}


//if there are no Cameras
if(cam == null)
{
    System.showSettings(3)
}
else
{
    cam.setMode(1024, 768, 30);
    cam.setQuality(10000,0);
    output.attachVideo(cam);
    setInterval(this,"takeSnapshot",100);
}

On exporting to SWF, I am getting the error :

The class or interface com.adobe.images.JPGEncoder could not be loaded

I have downloaded the as3corelibrary from the right source from code.google.com and have placed the folder in the root. Right now it is C:\wamp\www\com\adobe\images\JPGEncoder.as

Is there some classpath or something that I have to set ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T22:46:52+00:00Added an answer on May 15, 2026 at 10:46 pm

    Looks like you’ve put the code for as3corelib in the root of the web server – you’ve to put the source in the root folder of your source path. Normally that’s the same folder that has your FLA. Copy the com folder to the same folder that contains your FLA and then compile.

    In case you’ve your FLA in the same folder (the root of the web server), that’s a bad idea to begin with – everybody will be able to access your source code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a total Flash newbie. I just installed Flash CS5 and ran this
I am using the following code to load my flash file, contact a php
Let's Say I Have This Class: package{ import flash.display.Sprite; public class Main extends Sprite{
I'm a C programmer and a total newbie to Flash/video/web world. Don't know where/how
I am just starting to learn flash/actionscript 3 and decided to code up a
This is my layout: package layouts{ import mx.core.ILayoutElement; import mx.core.IVisualElement; import spark.layouts.supportClasses.LayoutBase; import flash.geom.Point;
I am a total flash newbie, and I'm looking to build an audio player
Total newbie question but this is driving me mad! I'm trying this: myInt =
Total noobie question here. I'm just learning Java, and studying passing arguments to functions.
Total newbie question, but I cant figure out what im doing wrong. I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.