Home > Default > Adding a jpeg to the stage

Adding a jpeg to the stage

November 30Hits:0
Advertisement
I have a jpeg loaded into my library, and under the file's properties, I have "export for actionscript" checked, with "one" in the Class field and "flash.display.BitmapData" in the Base Class field.
I have the following actionscript:
var pic_1 = new one();
material_mc.addChild(pic_1);
I'm getting the following error from the first line: 1136: Incorrect number of arguments.  Expected 2.
I've done this before with symbols in my library, but I seem to be having an issue with jpegs.
Any help is greatly appreciated.
Thanks!

Answers

Okay, I've altered it to:
var pic_1 = new one(563,339);
material_mc.addChild(pic_1);
Now I'm getting the following error on the second line:  
TypeError: Error #1034: Type Coercion failed: cannot convert [email protected] to flash.display.DisplayObject.
    at clifton_fla::MainTimeline/frame1()[clifton_fla.MainTimeline::frame1:15]
what am I doing wrong?
Isn't there a way to add an image from the library to the stage without having to specify it's width and hieght (aka, it uses the image's original width and height like it does when you're adding movieclips)?
Thanks!

Read other 7 answers

Tags:

Related Articles

  • Adding a jpeg to the stageNovember 30

    I have a jpeg loaded into my library, and under the file's properties, I have "export for actionscript" checked, with "one" in the Class field and "flash.display.BitmapData" in the Base Class field. I have the following actio

  • Adding a .jpeg still to an .mp3 - does it become a different format?October 11

    Just curious: When I drag an .mp3 file into an iWeb 08 page then a "Drag image here" appears. Question: If I add a still .jpeg image into the box then will the .mp3 file ultimately become a different sort of file format when it is accessed on th

  • Adding Many Items To A "Stage"October 11

    I have a list of images in a scrolling area and I'd like the user to be able to click the image and it would appear in a "stage" area that I have (they should be able to select as many as they like). I know how to do it with one image, but is th

  • Adding Activity to Sales Opportunity stageNovember 30

    I'm trying to create a new activity using the DI API and link it to a certain Sales Opportunity stage. I've been looking at the SalesOpportunities and SalesOpportunitiesLines objects to see if I could add an activity there, and I've looking at the Co

  • Adding gif/jpeg image to frameNovember 30

    Hi, Can anyone please tell me how to add a jpeg/gif image or an icon to the title bar ofa frame such that it appears before the title. Thanks    Image myImg=Toolkit.getDefaultToolkit().getImage(       getClass().getResource("YourImage.gif")); my

  • Objects added to the stage are not animated by AnimatorFactoryOctober 11

    Hi all, the following code ist a very simple animation. I added an object to the stage by dragging it from the library. Then I applied code generated by "Copy motion as AS 3" and the animation works fine. However, if i add another object by inst

  • Since updating to the latest version of Firefox (12) I can no longer save jpegs or other graphic files. I can save them with other browsers.October 11

    Firefox does not seem to recognize the graphic asset (the Save As File Type) pull-down bar stays blank. When I select the "All Files" type in the pull-down bar but that doesn't help. I've tried adding the .jpeg to the file name as suggested by a

  • Need help removing a bunch of objects added at runtime via a timerOctober 11

    Hi.  After adding an image to the stage, turning it into a Movie clip, and setting linkage in library to Export for Actionscript, I'm now using a timer to add a bunch of roses to the stage as a video plays. How can I get rid of all these clips once t

  • Creation of BP through Web UI.with Life cycle stage concept.October 11

    Hi, I am working on Life cycle stage. I have added the field " Life cycle stage" field in the Web UI. But now when i go to create a BP with a life cycle stage XXX, it throws a error saying "BP category 1 does not fit the data in category 2&

  • Best practice for adding and removing eventListeners?October 11

    Hi, What is the best practice in regards to CPU usage and performance for dealing with eventListeners when adding and removing movieclips to the stage? 1. Add the eventListeners when the mc is instantiated and leave them be until exiting the app or 2

Copyright (C) 2019 wisumpire.com, All Rights Reserved. webmaster#wisumpire.com 14 q. 3.534 s.