Loading images into movieclip

Hi guys,.

I'm new here! I was wondering if someone could explain to me what I'm doing wrong here.

As part of a mapping system of the Flash-based campus, I am creating an area of 'Information on the rooms' which displays some information about the rooms around the campus, according to the data stored in a Microsoft Access database.

The .asp file that I use works fine, and my dynamic text boxes display correctly the information that each record in the database is queried.

However, I also try to post a picture of the room. The image files are located in the same directory as the .swf, they are not progressive .jpgs. I tried to use the following code (which works for everything except images):

onClipEvent (data)
{
Create a Clip to load images in
mcRoomDatabase.createEmptyMovieClip ("MyImagesHolder", 0);

strName = name;
strBuilding = construction;
strType = Type;
strProjector = projector;
strSeats = seats;
strRoamNet = RoamNet;
strPosition = "Record" Add String (CurrentRecord + 1) add 'to' String (TotalRecords);

loadMovie (name + '.jpg', mcRoomDatabase.MyImagesHolder);

}

-----------

Nothing will load in the movieclip. If I use the code (for an imaginary room called Room100)

loadMovie ("Room100.jpg", mcRoomDatabase.MyImagesHolder);

the picture perfectly. If I put a new dynamic text box to display

Name & ".jpg".

It shows Room100.jpg, which is the same as what I walked when I try directly above.


I'm confused as to where I'm wrong? Sorry for the long post!

Thanks a lot for reading

Alex

We know not if you load external movie, then in the
film external loading a jpg. If you you have a synchronization problem in that the
scenario is not increasing and can run before the swf is completely
load.

You are better off with MovieClipLoader if you need to know when the swf file is
load so you can perform methods on the loaded swf file.

Or you can insert the code to load the image into each external swf file.

Other points:
1.
onClipEvent (data)
{
According to me, fires whenever bytes arrive, which could be several times
We if you are in test mode or live.
2.
Add the operator is deprecated. Use + instead.

http://livedocs.Macromedia.com/Flash/8/main/00002924.html

3. If you create a critical application mission your code reveals that you need
update your skills AS you use old techniques.

--
LON Hosford
www.lonhosford.com
Number of happy bits exempts your way!
"Alex UK" wrote in message
News:e1uj2d$RM4$1@forums. Macromedia.com...
Hi guys,.

I'm new here! I was wondering if someone could explain to me what I am doing wrong
here.

As part of the Flash-based campus mapping system, I am trying to create a
"Room
Information "box which displays some information about the rooms
around
the campus, according to the data stored in a Microsoft Access database.

I use the .asp file works properly and my dynamic text boxes
are
correctly display the information in each record of the database is queried.

However, I also try to post a picture of the room. Image files
are
located in the same directory as the .swf, they are not progressive .jpgs. I have
have tried to use the following code (which works for all, but)
the
images):

onClipEvent (data)
{
Create a Clip to load images in
mcRoomDatabase.createEmptyMovieClip ("MyImagesHolder", 0);

strName = name;
strBuilding = construction;
strType = Type;
strProjector = projector;
strSeats = seats;
strRoamNet = RoamNet;
strPosition = "Record" Add String (CurrentRecord + 1) add "from".
String (TotalRecords);

loadMovie (name + '.jpg', mcRoomDatabase.MyImagesHolder);

}

-----------

Nothing will load in the movieclip. If I use the code (for an imaginary
room called Room100)

loadMovie ("Room100.jpg", mcRoomDatabase.MyImagesHolder);

the picture perfectly. If I put a new dynamic text box to display

Name & ".jpg".

It shows Room100.jpg, which is the same as what I walked when I try
He
directly above.

I'm confused as to where I'm wrong? Sorry for the long post!

Thanks a lot for reading

Alex

Tags: Adobe Animate

Similar Questions

  • How to load images into layers or project

    How to load images into layers or projects.  I know how to use open to open a picture, but I was looking for a way load an image to resize to fit in a specific part of a layer or load an image, then one more.

    Yes, a script would be best for what you want to do, but you might be able to do it with an action. I haven't used actions too because I prefer scripting.

  • How to load images into different frames on a movieclip? And the creation of a clip empty?

    I want to be able to load external images into different frames in a movieclip and then to control inside the code. To do this, I need to know how to create a movieclip empty with a quantity of images can I specify in the code and how to put different pictures on different periods of the movieclip. How can I do this?

    When you create a movieclip in actionscript, it contains an image and there is no way to change/increase.

    You can create a movieclip with several images in the authoring environment and do what you want, but I don't know that makes a lot of sense.

  • Load image into ImageView using file:///

    Hello

    According to this article http://supportforums.blackberry.com/t5/Cascades-Development-Knowledge/The-Different-Methods-of-Loadi... we should be able to load images QML using file:/// and absolute path.

    For the life of me I can't load an image not only of shared/accounts/1000/shared/subfolders, but even of the application data folder.

    Can someone share * work * example of loading images in ImageView using file:///

    Thank you.

    https://developer.BlackBerry.com/Cascades/documentation/UI/Image_Resources/content.html

  • How to load images into memory

    I want to get the jpg of my webcam

    yesterday thanks to you

    I loaded jpg to the Simulator

    , but it has been imported to res java project

    How can I load the jpg into memory and read from the memory in the bb?

    If you know, or you know some post

    hot please answer T T

    This article will tell you how to read the jpg file in your project in memory.

    How - to add plain text or binary files to an application
    Article number: DB-00148
    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800620/How_To _...

    Then, you must convert the bytes into something that the BlackBerry can handle.  To do this, you use:

    EncodedImage.createEncodedImage (.);

    Now you get to get a Bitmap image, whose form the BlackBerry uses to display images on the screen.  This encodedImage object, you have created in the previous step and be used to get the bitmap image, simply use the

    getBitmap()

    method

    Now, the screen BlackBerry fields on the screen, so you must create a field for display, a BitmapField and tell him to use the bitmap image that you created.  It's easy, you just build a new BitmapField:

    BitmapField (bitmap Bitmap)

    Finally, you add the BitmapField to the screen you are viewing.

    There are shorter ways to do this, if you create a png rather than jpg images.

  • Add an image loaded at 2 movieclips

    I loaded an external image into a movieclip (say mcA) using MovieClipLoader.

    In AS3, we use addChild to add a movieclip in another movieclip or sprite, but in AS2, it must use attachMovie to attach the movieclip in the library.  Since it is an external file on the server, I can not use attachMovie.

    I have to add the content of the mcA, which is the image, to an another movieclip (say mcB) so that the mcA and the mcB contains the same image.

    How can I do this in AS2 without loading the image to the server again?

    Thanks in advance!

    Here is a link that provides a tutorial file where you can probably find what you seem to want...

    http://www.senocular.com/Flash/source/?entry=747

    You should also consider just reload the same image twice because after the first load, the following charges would most likely use the cached image.

  • Load images from XML to specific movieclip

    I'm still a beginner. I load the images into specific movieclip because they load on all the other layers. What should I do?

    I made a simple slideshow tutorial.

    I guess it would be better that I show all code parts are not specific:

    Import fl.transitions.Tween;

    Fl.transitions.easing import. *;

    Import fl.transitions.TweenEvent;

    var my_speed:Number;

    var my_total:Number;

    var my_images:XMLList;

    var my_loaders_array:Array = [];

    var my_labels_array:Array = [];

    var my_success_counter:Number = 0;

    var my_playback_counter:Number = 0;

    var my_slideshow:Sprite = new Sprite();

    var my_image_slides:Sprite = new Sprite();

    var my_label_slides:Sprite = new Sprite();

    var my_preloader:TextField;

    var my_timer:Timer;

    var my_prev_tween:Tween;

    var my_tweens_array:Array = [];

    var my_xml_loader:URLLoader = new URLLoader();

    my_xml_loader. Load (new URLRequest ("sshow.xml"));

    my_xml_loader.addEventListener (Event.COMPLETE, processXML);

    function processXML(e:Event):void {}

    var my_xml:XML = new XML (e.target.data);

    my_speed=my_xml.@speed;

    my_images my_xml =. IMAGE;

    my_total = My_Images.length ();

    loadImages();

    my_xml_loader. RemoveEventListener (Event.COMPLETE, processXML);

    my_xml_loader = null;

    }

    function loadimages (): void {}

    for (var i: Number = 0; i < my_total; i ++) {}

    var my_url:String=my_images[i].@URL;

    var my_loader:Loader = new Loader();

    my_loader. Load (new URLRequest (my_url));

    my_loader.contentLoaderInfo.addEventListener (Event.COMPLETE, onComplete);

    my_loaders_array.push (my_loader);

    }

    my_preloader = new TextField();

    my_preloader. Text = "Loading";

    my_preloader. AutoSize = TextFieldAutoSize.Center;

    my_preloader.x = (stage.stageWidth - my_preloader.width) / 2;

    my_preloader.y = (stage.stageHeight - my_preloader.height) / 2;

    addChild (my_preloader);

    }

    function onComplete(e:Event):void {}

    my_success_counter ++;

    If (my_success_counter == my_total) {}

    startShow();

    }

    var my_loaderInfo:LoaderInfo = LoaderInfo (e.target);

    my_loaderInfo.removeEventListener (Event.COMPLETE, onComplete);

    }

    function startShow (): void {}

    removeChild (my_preloader);

    my_preloader = null;

    addChild (my_slideshow);

    my_slideshow. AddChild (my_image_slides);

    nextImage();

    mon_timer = new Timer(my_speed*1000);

    my_timer.addEventListener (TimerEvent.TIMER, timerListener);

    my_timer. Start();

    }

    function nextImage (): void {}

    var my_image:Loader = Loader (my_loaders_array [my_playback_counter]);

    my_image_slides. AddChild (my_image);

    my_image.x = (stage.stageWidth - my_image.width) / 2;

    my_image.y = (stage.stageHeight - my_image.height - 20) / 2;

    my_tweens_array [0] = new Tween(my_image,"alpha",Strong.easeOut,0,1,2,true);

    }

    function timerListener(e:TimerEvent):void {}

    hidePrev();

    my_playback_counter ++;

    If (my_playback_counter == my_total) {}

    my_playback_counter = 0;

    }

    nextImage();

    }

    function hidePrev (): void {}

    var my_image:Loader=Loader(my_image_slides.getChildAt(0));

    my_prev_tween = new Tween(my_image,"alpha",Strong.easeOut,1,0,2,true);

    my_prev_tween.addEventListener (TweenEvent.MOTION_FINISH, onFadeOut);

    }

    function onFadeOut(e:TweenEvent):void {}

    my_image_slides.removeChildAt (0);

    }

    Did you give a name to the symbol instance that you dragged to the scene? His name should be "my_slideshow".

    NDS, please also remove addChild (my_slideshow);

  • XI player suddenly stopped to load all images into pdf files.  No idea why?

    XI player suddenly stopped to load all images into pdf files.  No idea why?

    Try to edit > preferences > Page display > Page content and information and remember that "Show large images" is checked.

  • Scaling of a MovieClip in AS 3.0 after the loading image in there?

    Hello

    I have a doubt regarding the scaling a movieclip. I tried this method where I do a clip dynamically, add an image I load my desktop. The image appears in good condition. But when I scale the movieclip by using the properties mc.scaleX and mc.scaleY the mc woudnt move.

    There must be a few other wat, we can achieve this. If someone can put in a few thoughts about this. Here's the code...

    //Load the image here 
    var url:String = "a.jpg";
    var urlRequest:URLRequest = new URLRequest(url);
    var loader:Loader = new Loader();
    loader.load(urlRequest);
    //addChild(loader);
    
    //Create the movieclip here and add the image to it.
    var mc:MovieClip = new MovieClip();
    mc.buttonMode = true;
    mc.addEventListener(MouseEvent.CLICK, clickHandler);
    addChild(mc);
    mc.addChild(loader);
    mc.x = 120;
    mc.y = 50;
    
    function clickHandler(event:MouseEvent):void {
    trace("You sunk my battleship!");
    }
    
    
    
    

    In the code I haven't used scaling codes because it does not work. And when I add the code of two lines, the image disappears, but the mc is on the scene that is clickable. Maybe I should place my mc inside a container?

    Regards and thanks in advance.

    Roshan Kolar

    For the code you show, using a different image, I added:

    mc.scaleX =. 5;
    mc.scaleY =. 5;

    After the reinstallation code and it works fine.

    How did did you encode it?

  • How to load the image into the Blob field in Sql?

    Hello

    I want to know how to load the image into the Blob field in Sql

    Concerning


    Therese

    Re: How to load the image into the Long Raw column?

  • Order a swf file loaded into movieClip

    Help!
    I loaded a {swf slide} in a clip... on stage... with the help of the
    var loader:MovieClipLoader();
    using a clip of button it is embedded in a separate swf file that is loaded at run time
    but the {swf slide} is runing an interval I need of clare... so is there a way to talk to the swf file after you load it into a Movie Clip how do deal with that

    Post here when your site is ready. in this way other disciples of thread can check it also.

  • AS3: dynamically load images in the MC

    Hello

    Currently I have 20 separate png images in the library to make a MC. So, there are 20 MC, each holding a specific image for which it is the right size.

    I want to put in place instead and need help with, to load dynamically a different set of 20 images (that I can add to the library), each one of the MC.

    I think I would need to create 20 empty MC to contain either of these sets of 20 png every first.

    What I need help: how this script so that the 2 buttons can be used: one button would charge the first series, each image in a MC empty specific which is sized to hold (total of 20 MC), and a second button to load the second series of 20 images, each in a specific empty MC that would also be correct size. I checked the loader class, but this seems to be the external URL for images not already in the library.

    Any help, suggestions appreciated.

    saratogacoach

    I hope that you are familiar with how to add dynamically to movieclips in the library.  You do this by assigning a class name to the movieclip in the library and declare you a new instance of movieclip, a lot like you were doing it just for the MovieClip class generic.

    It can work the same way a little to add images.  Right-click on the image in the library and click Properties.  In the Panel that appears, go to the tab inside Actionscript and assign a class name.  Let's say you name UIImage.  To load it into the movieclip you just created you can use...

    var _mcImage:Bitmap = new Bitmap (new UIImage (0, 0));
    _mc. AddChild (_mcImage);

  • How to load images dynamically in Flash

    I have a clip on the stage I want to dynamically load images in (constantly changing), how can I get it? Thank you.

    Use the Loader class to load in images.

    Then use addChild to add the class Loader in your MovieClip on the stage.

    That & quot; constantly change & quot; What do you mean by that? You can use setInterval, ther enterFrame event or any other way to trigger a new image to load into the loader instance.

    Finally, you can use the Tween class to create some nice effects for images (fade, blur in the picture mix, masks, etc.)

  • How to load images side when the swf file is hosted on a server without uplaoding it to the server?

    I am trying to build an online image resizing tool.
    problem I encounter are:

    1. create a button that allows the user to browse the file. Once the file is selected, it only shows the full path.
    2 lets say if she shows fullpath, but I try to load it into a movieclip, and this does not work because the swf file is located on the server and put the client.
    3. as far as I know, flash can only load the images located in the same server or internet.
    4. If I use php, asp, cgi... It can only make me 1 upload the image then resize later, but this is not wat I want.
    5. I need to 1 resize then download later, because if I have 100 and more photos taken of the digital camera, it's going to be very slow and cumbersome.

    What I tried:
    1. download 'image3.jpg' in the same directory as the "viewer.swf", and it works.
    2. not to upload the swf file to the server, but locally managed from the user's computer and open 'image3.jpg' and it works.
    3 upload the swf file to the server and open "image3.jpg" of the user's computer and the IT DOESN 'T WORK!

    Please help me.

    Thank you ~!


    Adobe air is in Beta 2 and is free:

    http://labs.Adobe.com/downloads/air.html

  • How to load images in the email for adapter UMS

    Hi all

    I try to send a string of HTML in the body of the email to the the UMS adapter. But I would like to have/embed images in the HTML body before sending the email. Where can I store images and load them into the SOA?

    Please let me know

    Hi Aditya,

    I didn't test this, but you could try using tag to call the image in the body of the e-mail activity (body allows html). For the source of the image, you can set up a folder to keep your images and then give the path to the image as a source.

    Kind regards

    SAI

Maybe you are looking for