all groups > flash actionscript > april 2006 >
You're in the

flash actionscript

group:

Loading images into movieclip


Re: Loading images into movieclip massiveheadwound NO[at]SPAM gmail.com
4/16/2006 9:08:36 PM
flash actionscript:
maybe try

strTemp = Name + ".jpg"
(print strTemp to make sure)
loadMovie(strTemp,mcRoomDatabase.MyImagesHolder);

?
Re: Loading images into movieclip Motion Maker
4/16/2006 10:46:25 PM
It is not clear if you are loading an external movie and then in the
external movie loading a jpg. If you are you have timing problem in that the
script is not syncronous and may execute before the swf is completely
loaded.

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

Or you can insert the code for loading the image in each external swf.

Other points:
1.
onClipEvent(data)
{
I believe fires everytime bytes arrive which could be many times depending
on if you are in test mode or live.
2.
add operator is deprecated. Use + instead.

http://livedocs.macromedia.com/flash/8/main/00002924.html

3. If you are creating a mission critical app your code reveals you need to
update your AS skills as you are using older techniques.


--
Lon Hosford
www.lonhosford.com
May many happy bits flow your way!
[quoted text, click to view]
Hi guys,

I'm new here! I wondered if anyone could explain to me what I'm doing wrong
here.

As part of a Flash-based campus mapping system, I am trying to create a
'Room
Information' box that will display certain information regarding rooms
around
the campus, based upon data stored in a Microsoft Access database.

The .asp file I am using is working correctly, and my dynamic text boxes
are
correctly displaying the information as each database record is queried.

However, I am also trying to display an image of the room. The image files
are
located in the same directory as the .swf, they are non-progressive .jpgs. I
have been trying to use the following code (which works for everything but
the
images):

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

strName = Name;
strBuilding = Building;
strType = Type;
strProjector = Projector;
strSeats = Seats;
strRoamNet = RoamNet;
strPosition = "Record " add String(CurrentRecord+1) add " of " add
String(TotalRecords);

loadMovie(Name + ".jpg", mcRoomDatabase.MyImagesHolder);

}

-----------

Nothing is loading into the movieclip. If I use the code (for an imaginary
room called Room100)

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

the image displays perfectly. If I set a new dynamic text box to display

Name + ".jpg"

it displays Room100.jpg, which is the same as what I'm entering when I try
it
directly above.


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

Many thanks for reading

Alex

Loading images into movieclip UK Alex
4/16/2006 11:13:17 PM
Hi guys,

I'm new here! I wondered if anyone could explain to me what I'm doing wrong
here.

As part of a Flash-based campus mapping system, I am trying to create a 'Room
Information' box that will display certain information regarding rooms around
the campus, based upon data stored in a Microsoft Access database.

The .asp file I am using is working correctly, and my dynamic text boxes are
correctly displaying the information as each database record is queried.

However, I am also trying to display an image of the room. The image files are
located in the same directory as the .swf, they are non-progressive .jpgs. I
have been trying to use the following code (which works for everything but the
images):

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

strName = Name;
strBuilding = Building;
strType = Type;
strProjector = Projector;
strSeats = Seats;
strRoamNet = RoamNet;
strPosition = "Record " add String(CurrentRecord+1) add " of " add
String(TotalRecords);

loadMovie(Name + ".jpg", mcRoomDatabase.MyImagesHolder);

}

-----------

Nothing is loading into the movieclip. If I use the code (for an imaginary
room called Room100)

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

the image displays perfectly. If I set a new dynamic text box to display

Name + ".jpg"

it displays Room100.jpg, which is the same as what I'm entering when I try it
directly above.


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

Many thanks for reading

Alex
Re: Loading images into movieclip UK Alex
4/17/2006 12:30:56 PM
Dear Newsgroup User,

Many thanks for your reply.

I took your advice and did some reading in this particular area and made some
changes to bring my code up to a more modern standard - everything works
perfectly now.

Thanks again for your help.

Best wishes,

Alex
AddThis Social Bookmark Button