Adding a bitmap graphic to a movieclip in code

Hi, I'm new to as3 and programming and I'm trying to add a bitmap to a movie clip in code. However, I'm having trouble getting the bitmap location to go where I want it because it's inside the movieclip and it just shows up at 0,0 of the movieclip instead of the coordinates I want it to be: Here's some of code so you can see what I mean:
imageBitmapData3 = new Lander(63, 53);
_player = new Bitmap(imageBitmapData3);
_gameLevel.addChild(_player);
_player.x = 145;
_player.y = 90;
-Instead of showing up at 145, 90 It just shows up at the movieclip, _gamelevel, 0,0.
does anyone know how I could get it to do what I want it to do? I want to add it inside the mc because I need everything to move with the _gameLevel background when I move it.
Thanks

hi
your code looks fine to me - you could try adding a breakpoint after _player.y = 90 and see if the bitmap is in the right place when the breakpoint is reached, if it is, there must be some code elsewhere that is subsequently changing x/y to zero?

Similar Messages

  • Adding bitmap/graphic/movieclip to textfield

    Using just the basic textfield I know that I can add an image to it using the <img src=' '> tag. Which links to an image that is not part of my published swf.
    Is there a way to specify the source as a bitmap, graphic, or movieclip instance that is set to export for actionscript?

    Ah. It doesn't seem to work for an exported Bitmap, but it does for an exported Sprite or MovieClip. Set the library item to export as myPicture and then use:
    myTextField.htmlText=" <img src='myPicture' />"
    Oddly it seems to need a space or some other character in there or else it won't work...hmmmm

  • How Do I Make Bitmap, Graphic, or Movie Clip into a clickable link??

    I am designing a website entirely in flash (macromedia flash) but I cannot get the bitmap, graphics, or movie clips clickable links, although when hovered over turns into a hand.  Any suggestions? I have also tried the following script;
    on (release){
    getURL("http://www.google.com/", "_blank")
    Obviously I didnt use google, but still no go.
    I'm hot linking the raw fla file below.  I bought this template online and have modified it alot (all cosmetic) but I cant get the tabs to be links!?  I used action script (the one posted above) in every layer and the text inside the tabs.  But still doesnt work Does anybody know whats wrong?
    Sorry, but I dont know much in action script, I'm a c++ and web designer, this is my first time working in only flash.
    http://www.hotlinkfiles.com/files/2449178_iizru/_menu2_fv8.fla
    Here is my modded template in my website:  http://9karim.com/adminI only need to modify the menu bar

    I wouldn't say you're screwed, you just have some work ahead of you to find out what are actually the buttons in that thing.  If you look at the file on stage you'll see a large turquoise shape (an invisible button) that when you select it shows it has an instance name of "menu"... I still couldn't figure out what it has to do with those animated tabs, but it may lead to further discoveries.
    There's a lot of stuff woven into that file, and with the frame by frame animation, it's hard to isolate just about anything.  Based on what I see in the library as far as object naming goes, and your not knowing what's where, I'd conclude that this is an "acquired" design that has been decompiled into the fla you are trying to figure out.  While I haven't any experience with decompiled files, it wouldn't surprise me if there is an increased level of complexity as a result of how the decompiler rebuilt the file.

  • Bitmap graphics print poorly in PDF

    For bitmap graphics, I find that the online version has to be
    shown at 100%. When the true image is bigger and I specify a
    smaller size, the image "crunches" in an illegible way. So I make
    the image size correct for showing at 100%. But this same image
    comes out ugly and often unreadable in the PDF version. This
    problem occurs not only with screen shots but even with Visio
    diagrams saved as GIF. How are people handling this problem?

    ID @ 100%
    PDF @ 100%
    The PDF always looks this way, irrespective of the magnification. You can even see variations in size of each dot along the vertical line.
    I've tried outputting from ID with and without compressed line art, and have adjusted Acrobat Pro to smooth (and not) for LCD screens. No dice.
    One other thing: don't know why there's a size difference between ID and the PDF. Both set 100% @ 96 DPI. Odd.
    Ta,
    NR.

  • Optimisation of bitmap graphics

    Can anyone help? I have to do a report on the optimisation of bitmap graphics in CS4 for college, but it is utter Martian to me!
    Could anyone give me tips on a few things:
    -file format
    -res
    -dithering
    -file size
    -quality
    -bit depth
    -compression
    -delivery mechanisms
    -alpha channels
    I'd appreciate any hints or tips, and I know this looks like a call to have my 500 words written for me, but I don't expect that. So far I have my name at the top of the page, the date and little flashing/blinking vertical line where I intend to type next, and then there I am just staring through eyes stinging with nervous sweat.
    All mini-tips, over-the-top explanations and sarcastic put-downs will be gratefully welcomed.
    BC.

    Goggle and Wikipedia are your friends.  I have researched all of those exact terms and there is tons of information available.  You can also access the online version of my book at:
    http://rockynook.com/glossary/index.php/Online_Glossary_of_Digital_Photography
    John
    John G. Blair Studio

  • Resizing bitmap graphics

    How can you resize the bitmap graphics? I know the book says you can't do it but I am sure someone has been innovative enough to find a way.

    You can use any good graphics package to resize a bitmap. For instance, Paint Shop Pro (PSP) does a pretty good job. You may download a trial version of PSP from download.com.
    You can also save the bitmap as a WMF in PSP if you wish to resize the graphic within Lookout. Use the Animator object for resizing it at runtime.
    Hope this helps.
    Rgds,
    Khalid

  • Adding colour and graphics to a j2me form

    hi guys im trying to find info abt adding colour and graphics to a j2me form if anyone can help with any suggested links or info that would be great help thanks .

    [http://developers.sun.com/mobility/apis/articles/3dgraphics/]

  • Graphical content of movieclips 'lost' on copy and paste

    Hey,
    I'm working with Flash CC and every so often after copying a lot of assets from one fla to another, I'll notice a whole bunch of graphics have gone missing.
    That is, the movieclip in the library that previously contained a Shape or Drawing Object still exists, but it contains precisly 1 blank keyframe on 1 layer - all graphics "deleted".
    I suspect this is a bug in Flash CC, is anyone from Adobe able to comment?
    It happens only rarely and randomly, but I've fortunately managed to re-create the situation with a fairly simplified .fla
    So in a source .fla I've got a button with a single simple movieclip in it used as a background. This movieclip contains some graphics in it (in my test case this is nothing more than a rounded white square).
    I copy that button from the source into a destination .fla (full of other movieclips and junk at random) - it also contains a movieclip with the same name as the source .fla.
    Normally I'd expect to see a dialog saying "would you like to replace assets" with the usual options, refering to the buttons background movieclip , but on this occasion something goes wrong and I get no dialog.
    Flash continues to copy the button across perfectly happily, but the background movieclip comes across blank, no sign of the white rounded square, no error messages or warnings, just all graphics gone (eek!).
    I wonder if it's because another movieclip, with the same name, exists in the destination, but in a different folder location? Or whether Flash has kept a reference to the source file it was originally copied from? (I can't see anything obvious).
    The major problem is we don't know when this might occur or how, and to date it's only been noticed post release of a product once (we've caught the others before our client has noticed!).
    Anyone else experienced similar symptoms?
    I'm using Flash CC 13.1.0.226 (I've run out of hdd space to try 2014!).

    Hi Nipun,
    I'm aware that if there are 0 symbols like that clip in the destination library it'll copy it in - there'll be no symbol for it to have a conflict with.
    What I'm wondering is why it won't produce a library conflict when the symbol is at the root level.
    I'm a little confused as to how the current situation would be useful.
    In a normal use case I'm copying assets (several hundred in total) from many different .fla files into one new one to make a new project. At some point one of those symbols gets CORRUPTED and goes blank - no matter how that's happened, when I copy over a new movieclip I expect to be able to replace the visuals. Quite often we'll use a button background clip like this to simply change the colour scheme for a different clients work - so that white rectangle could be blue.
    Perhaps there are 2 bugs:
    1) Somehow the symbol gets corrupted
    2) I'm not able to replace the graphics in the movieclip without manually doing it by editing the symbol.
    Again the main problem for me is the lack of ability to spot this problem, we've wasted hours trying to figure out what goes wrong, and so far my best suggestion to staff is simple "avoid using Flash CC" which I think we can agree is not a brilliant recommendation!
    Geoff

  • Control movieClip by codes in a class

    how to create a movieClip with codes and control it to play
    ,create keyframes by codes,and put something in keyframe,I want to
    do this by programing codes not by tools in FlashCS3,thanks!

    Hi,
      I am just trying to understand your requirement clearly. Is it that you want to control the complete order of the value set for dropdown or just looking to change the selected value by default.
      If you are looking to change the default selected value then you can do as below.
      Since you are using DROPDOWNBYINDEX, you can achive this by setting the lead selection of the context node. The lead selected one, will be shown as default in the dropdown.
      I am using your example code.
    lo_nd_cn_drpindex->SET_LEAD_SELECTION_INDEX( index = n )
    "where n is the index of the row that you want to appear default in dropdown. This could be lastly added
    " one, middle one or any thing from the value list
       If you are adding new value to valuelist of dropdown, add it and then set the lead selection to this index sothat this willl be the first displayed one
    Regards,
    Manne.
    Edited by: Raja Sekhar Manne on Jun 25, 2009 2:26 PM

  • Graphic tool to generate java code

    Does it exist any graphic tool that generates java code from the shapes? something like the form editor of Netbeans for example, or a plugin for other graphic editors like adobe photoshop...
    tnx a lot
    I tried to search through the the whole web or java.sun.com, but i cannot get less then 350000 sites...
    Wil

    Possibly free, of course :)

  • How would I go about adding multiple rectangles using the same lines of code?

    How would I go about adding multiple rectangles using the same lines of code? I would prefer to just run through a set of code every time I need a polygon. If I just have to create multiple polygon adding statements that's fine but I'd prefer just 1.

    >>How would I go about adding multiple rectangles using the same lines of code?
    You could create a method that creates and returns x number of Rectangle elements:
    public IEnumerable<Rectangle> CreateRectangles(int numberOfRectsToCreate)
    for (int i = 0; i < numberOfRectsToCreate; ++i)
    Rectangle rect = new Rectangle();
    rect.Fill = Brushes.Blue;
    rect.Width = 100;
    rect.Height = 100;
    yield return rect;
    ..and then call this method from anywhere in your code:
    IEnumerable<Rectangle> rects = CreateRectangles(5);
    foreach (Rectangle rect in rects)
    //add to StackPanel or do whatever with the Rectangle elements:
    yourStackPanel.Children.Add(rect);
    >>If I just have to create multiple polygon adding statements that's fine but I'd prefer just 1.
    When adding Point objects to a Polygon you can only add one per call to the Add method but you could call the Add method inside a loop, e.g:
    for(int i = 0; i < 10; ++i)
    //add to StackPanel or do whatever with the Rectangle elements:
    Polygon p = new Polygon();
    p.Points.Add(new Point());
    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't post several questions in the same thread.

  • Correct way to implement cache as bitmap to deeply nested movieclips? help!

    I've been really stuck at this problem for a number of days and cant find any help online as to where im going wrong.
    1119: Access of possibly undefined property CloudsNAnim through a reference with static type Class.
    the setup as of now, there are 4 movieclips i want to cacheasbitmap. two copies of a vector movieclip called CloudS2 and two copies of one called CloudS4
    those are in a movieclip holding them called CloudsNear and another movieclip holding that which holds an animation of the CloudsNear movieclip moving past the screen in a loop which is called CloudsNAnim
    and that is inside the main level which is added to the stage called PlaneLevel
    where do i place the cacheasbitmap lines in my code to load them into memory before I load the main movieclips
    package
          // all my imports etc //
        public class MightyMend extends MovieClip
            public function MightyMend()
                // constructor code
                addChild(PLoading);                      //this loads my loading screen png to the stage
                stage.addEventListener(Event.ENTER_FRAME, loading); //reoccuring event listener happens as often as is set by FPS
                PlaneLevel.CloudsNAnim.CloudsNear.CloudS2.cacheAsBitmap = true;    
                PlaneLevel.CloudsNAnim.CloudsNear.CloudS4.cacheAsBitmap = true;     //these lines dont work
            private var PLoading:Bitmap = new Bitmap (new PlaneLoading());       
            private var PLevel:PlaneLevel = new PlaneLevel();   
            public function loading(e:Event):void //
                var total:Number = this.stage.loaderInfo.bytesTotal;
                var loaded:Number = this.stage.loaderInfo.bytesLoaded;
                var percent:Number = loaded/total * 100;
                trace (percent);
                if (total == loaded) //checks if all bytes for all movieclips have been loaded
                    stage.removeEventListener(Event.ENTER_FRAME, loading);
                    onComplete();
                     //the rest of the code staes that when oncomplete it will remove the loading screen and add the plevel to the stage etc..

    The movieclip is called Plane_Level but i had linked it to actionscript as a class nameed PlaneLevel
    im not sure if that makes a difference but when iadded that declaration
    the line :
    private var PLevel:PlaneLevel = new PlaneLevel();
    now gives an error
    1046: Type was not found or was not a compile-time constant: PlaneLevel.
    1180: Call to a possibly undefined method PlaneLevel.

  • The color white in a colored Bitmap graphics in sapscript is not white

    Hello, I have added a colorred logo in a sapscript. The logo is made with paint.
    When i print this logo with se78 or in the sapscript the white in that logo is a little grey.
    also the background colour is a little grey.

    The image you are using in your form in case if you have uploaded from presentation server you have to change the settings of your image as 256-bitmap image then use it in your form .
    I hope this will solve problem your problem.
    Edited by: Syed Abdul Adil on Aug 5, 2008 3:59 PM

  • Speaker problem with t420i and adding a new graphics card question

    I bought a t420i about a month ago and noticed that the speakers could not properly handle muliple sounds at once.  What happens is that, say in a music video, the music plays loud and clear, but once the lyrics start the background music fades a bit to about 85% of it's original volume.  I had returned the laptop because of this problem but the replacement I got has the SAME exact problem.
    In case im not clear, try this example.  You know the beeping noise you get when you press an incompatible set of keys?  ( like g, h, and b).  When I have this noise going simultaneously with a song, the song's sound fades a bit.
    This does not happen with headphones, therefore i believe the problem is with the way the speakers are programmed.
    Also, if I bought a t420 with just integrated graphics, could I still add a new graphics card?  Or can you only add a new graphics card to a thinkpad that initially comes with discrete graphics?

    I think the main purpose of the nvs4200m is the ability to use three displays (internal + 2 external). Additionally, nVidia has better driver support for games so even though it is around the same speed, the drivers are better. 
    The shared ram is still used, unless you disable the HD3000 in the BIOS and run with only the nvs4200m at all times. 
    When asking for help, post your question in the forum. Remember to include your system type, model number and OS. Do not post your serial number.
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"! This will help others with the same question in the future.
    My TPs: Twist 2HU: i5-3317U Win 8 Pro, 4GB RAM 250GB Samsung 840 | T420 4177CTO: i5-2520M, HD+, Win 7 Pro x64, 8GB RAM, Optimus, 160GB Intel 320 SSD, Intel 6300 WiFi, BT 3.0 | T400 2764CTO: P8700, WXGA, Win 7 Ult x64, AMD 3470, 8GB RAM, 64GB Samsung SSD, BT, Intel 5300 WiFi | A20m 14.1" PIII 500 (retired). Monitors: 2x Dell U2211h IPS 100% sRGB calibrated w/ Spyder3.

  • Adding a new graphic in Flash

    Hello all. Very new on the Adobe Flash scene. I'm trying to
    figure out how to add a graphic of mine to a flash. I'm pulling my
    hair out. I have several templates in flash and can modify these at
    will, but they already have existing graphics; It's a snap to
    import my own.
    How do I create one of my own? I think they are called
    symbols? I can create one of those, layers all that. How do I get a
    graphic into those?
    Thanks for the help. I hope to learn a great deal from
    here.

    File -> Import -> Import to Library and then navigate
    to where your .psd is.
    http://livedocs.adobe.com/flash/9.0/UsingFlash/help.html?content=WSC23C276E-0FD8-426e-B29B -742122476BC0.html

Maybe you are looking for

  • A Few Questions about Portal Server6.2 on Windows XP

    Using jstudio_ent_04Q4, I installed the following components on Windows XP Pro: * AppServer7 * DirectoryServer5.2 * IS6.1 * PortalServer6.2 We created a portal app by the following steps: * deploy our portlets wars (use IS/bin/pdeploy.bat) * copy the

  • Missing Contacts in Outlook 2013

    I have an "incomplete" list of contacts on my Windows 8.1 laptop when compared to my Windows 7 desktop. The Outlook calendar is synced. I can correct information on a contact with my Win7 Outlook and it will be corrected on the Win8.1 laptop. But the

  • Connecting apple tv to a stereo amplifier

    my apple tv is connected to tv with a hdmi cable and it works. i want to connect it to a stereo amplifier without passing through tv. since apple tv has only optical cable outlet, i bought a optical to analog converter. but still i haven't get sound

  • Problem about  logon ticket cookie

    Hi all,     We have just set up  trust between two portals.And we want to archive this:     One user log on a portal(consumer) and he can logon another(producer) with logon ticket.     But one problem is:     One user log on consumer and access the p

  • My ipod touch has a box around everything i touch

    At first the touch wasn't working.  Finally the battery died and I was able to charge it and now the slide isnt work right, its very slow. i have to double tap an icon for it to work. a box appears around anything i touch even around the time.