Center content in loader component
Hi,
I'm trying to use the movie class loader component to set up
a photo gallery.
I want to center all of the images, but they are staying to
the top left.
Any suggestions?
Thanks!
cannot see any way to edit or delete posts so im going to have to add another one on to the end....
The insertComponent(component) method does not work. it simply adds nothing to the JTextPane. i looked at some other psots that suggested setting the text pane to editable, then adding then setting back to uneditable but that didnt work. i have a class that extends JFrame which calls the construction of the JTextPane
the JTextPane runs through a html file rendering itself as it goes, but when it gets to the image and calls the method insertComponent(image) it just doesnt show up in the JTextPane whe nthe JFrame finally opens up.
If i use the method add it shows up fine, just not centered where it should be. Any ideas?
Similar Messages
-
Loader component not scaling content
I am using a loader component to load an external swf into
main movie. As swf plays, content that should be off stage is
showing outside the box of the loader. Scale content is set to true
and swf is sized down, but will not stay within loader.Yes, because of the size of the stage being larger than that
of the Loader and loaded SWF, you will see it rendered 'outside'
the Loader component.
Simply mask the area of the Loader Component, in the loading
SWF. -
Loader Component IE7 Scaling Content Issue
Hello,
I have an image gallery that is using Loader components to
pull in the thumbnails and i have the scaling set to true, but in
IE7 it is very inconsistent in scaling... IE6 and Mozilla work
great, but IE7 is inconsistent... click on the top left to view
image galleries, then select Family or Weddings and you can see
what i mean..
http://www.gummyinteractive.com/projects/infinite/
thanks in advance!Yes, because of the size of the stage being larger than that
of the Loader and loaded SWF, you will see it rendered 'outside'
the Loader component.
Simply mask the area of the Loader Component, in the loading
SWF. -
Loader component not displaying content
I had this issue on a few different projects and have not
been able to find a solution:
When loading an image with the loader component, the image
only displays about half the time even though the complete event is
received. I sometimes see a quick flicker of the image.
I have tried both calling invalidate() and resizing after
loading has completed, but does not help.i had a similar issue with that, what i did was create a
class.
this class was linked to a movie clip, and whenever i'd need
an image loaded, i'd simply attach this movie.
as for resizing and positioning of the image, i also did a
code in my enterframe that always made the image centered with a
max size and height of 100, that way it was always proportionate
and i could simply control the size by controlling the xscale and
yscale of the image movie clip.
hope this helps
class image extends MovieClip {
function image() {}
function loadImage(sPath){
this.createEmptyMovieClip("mContent", 0);
// you can also attach a loader there
this["mContent"].loadMovie(sPath);
this.onEnterFrame = function () {
if(this["mContent"].getBytesLoaded() ==
this["mContent"].getBytesTotal()) {
//remove the loader
this["mContent"]._visible = true;
} else {
// update the loader
this["mContent"]._visible = false;
} -
I'm not too sure I want to troubleshoot anymore when it comes
to the Loader component and IE7, but I wanted to check if anyone
has anything new on the matter. All searches concerning this issue
show unanswered posts, so I guess it's just another bug/conflict
that Adobe isn't concerned about or if the issue is just with IE7.
The main issue is when loading images into the loader component,
scaleContent set to default (true), autoLoad set to default (true),
when images are loaded, they are not always aligned properly in the
center. Plus, most of the time I see a flicker of the image
appearing either on the top left or bottom left of the loader
before the image appears as it should. I've even tried AS2 to
center the loader.content._x and loader.content._y on
listener.complete (see code), but randomly the loaded image's (0,0)
position seems to be in the center of the loader (I was going to
provide a screen shot of what I'm talking about, but I think the
explanation is clear). All the above works great on Firefox, Opera,
Safari, and even the crappy AOL browser, but not consistently on
IE7.
Is this a known issue or an unsolved bug?
Unless anyone has an answer to the above, I would like to
also ask around about purchasing loader components online. I've
seen several, but wanted some testimonials from people who have
used them.
If anyone wants to visually see what I'm talking about, go to
Design Visions of
Austin and click "on the boards". If you compare the website
using Firefox versus IE7, you will see what I mean.
Thanks to anyone who can help. I hope this post doesn't go
unanswered. In the past, I've helped a lot of people, so I would
appreciate if someone could help me for once :) thanks again...
I just realized... two variables I mentioned in my code were
assigned prior to the attached code.
var cpLoader:mx.controls.Loader;
var cpLoaderWidth:Number = cpLoader.width;
var cpLoaderHeight:Number = cpLoader.height;The flicker happens on both FF2 and IE7, and is because you
are positioning after the load is complete. To solve this, set the
visibility of the Loader to false (cPLoader._visible = false;)
before moving the content, and to true after. IE (you could try it
this way, but it might not work)
cpLoaderListener.complete = function(evt_obj:Object) {
mcPreloaderClip._visible = cpLoader._visible = false;
var cpLoaderContentWidth:Number = cpLoader.content._width;
var cpLoaderContentHeight:Number = cpLoader.content._height;
cpLoader.content._x = (cpLoaderWidth - cpLoaderContentWidth)
/ 2;
cpLoader.content._y = (cpLoaderHeight -
cpLoaderContentHeight) / 2;
cpLoader._visible = true;
It would be better to set cpLoader._visible = false on the
button click that loads the image, maybe with an automatic fade out
implemented to make it smoother. Then setting it back to true after
moving it fixes the flicker effect.
As for the centering not working in IE7. The very first image
does not center properly in IE7, but after that everything works
identical to FF. I am unsure how to fix that issue. I have always
implemented a centering script myself to ensure that things get
centered properly, and have not yet had any problems with it. -
ContentPath not working in a loop for a Loader component
i'm trying to load pics into a loader in my movieclip, i'm
looping through about 20 items, to be placed in a movieclips
dynamically attached...
this does not work...
mcContainer['node'+nCount].pic.contentPath=myimagepath;
this does work...
mcContainer['node'+nCount].pic.loadMovie(myimagepath);
but it does not come in scaled / sized like I want...
any reason why the images do not appear in the loader
component in the movieclip? it's like the screen is not being
refreshed or the loader never finishes, when I trace the
contentPath after the fact it says the right path, but no image is
there.contentPah is used to specify linkageID's only, and will not
work for a URL. you correctly used the load method to get the
picture in there, now you just have to scale it. if you set the
loader's scaleContent to true, your image will scale to the
loader's size, and vice versa if you set the property to false. if
you need to do some custom scaling based on the size of the image,
you can grab those properties like so:
myLoader.content._width
not that the above property, and any scaling commands, will
only work after the loader finishes loading, so you'll need to put
that stuff in an event handler for the loader.complete event...
hope that helps -
I noticed that when using the Loader component in Flash 8 -
the following issue:
I have a thumbnail gallery that uses the Loader component to
view the large image.
when i view the site in fire fox it works perfectly (scaling
the content and centering it within the loader component shape)
but when i view it in IE - no scaling or centering occurs!!??
any idea why this is happening and how i can rectify
it?Hey why don't you try adjusting the permissions and hot
linking protection on your servers control panel? This might be the
problem. -
Window Component with Loader Component
I have the SWF loading into a shell using a Loader component.
Within one swf is a trigger for a window - which ,suprise suprise,
doesn't work. It works fine if I access the swf directly just not
when loaded through the shell. I have added the component to the
shell fla and then although a window component loads up, the
content (which is linked in the library) is not found. Anyone come
across this before?There is a discussion of modules and popups on my blog
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui -
... I'm trying to get the imaged that's loaded within
an instance of a loader component.. is there a way to align the
image that's inside?Look in the online help at the Loader object and specifically
at the info on Loader.content. The example will show you how to
assign the loaded content as a movieClip instance. Then you can set
new values to any of the properties of that clip. -
Hello,
I'm trying to load an external image (JPG) that is 5000 by
300 Pixels.
The Loader component seems to be cropping the image at about
3300 by 300.
Is this the max size?
If so is there a work around ?
Else then why will it crop at this size when it is not being
specified anywhere?
Please Advise this is a time crtical question.BrunoSousa2006 wrote:
> Hello,
>
> I'm trying to load an external image (JPG) that is 5000
by 300 Pixels.
> The Loader component seems to be cropping the image at
about 3300 by 300.
> Is this the max size?
the max size is 2880, anything beyond that size will cause
problems.
> If so is there a work around ?
Yes, cut content into smaller parts, load it and put it up
together into one.
Best Regards
Urami
!!!!!!! Merry Christmas !!!!!!!
<urami>
If you want to mail me - DO NOT LAUGH AT MY ADDRESS
</urami> -
Remove loader component temporarily?
Hi,
I am loading images dynamically into a loader component named
myPicLoader.
I want myPicLoader to be "unloaded" when I go to the home
page, then reloaded when I go to the image page.
Making the loader visible = false doesn't work since it only
hides it.
Any suggestions?unload the content:
myPicLoader.unload();
Then null out the myPicLoader instance and make sure it's
recreated when you need it again (good time to have your loader in
a separate class file. :) )
myPicLoader = null; -
How to show a splashscreen in a FLASH AIR game while content is loading
Hi,
I've seen some games take some time to load (something completely reasonalbe and normal). So I guess it would be really interesting to have a way to show a splash screen while the content is loading.
Any common aproach to face this problem?
Thks.The solution is generally to break up the operation that is taking a long time into smaller chunks. If for example, you have a long loop executing, then AIR never gets a chance to update the screen (or respond to the OS messages).
The first step is to identify what part of the process is taking such a long time.
See http://senocular.com/flash/tutorials/asyncoperations/ for a good explanation.
And to put up a progress bar, you have to do this anyway, otherwise the progress bar will never get updated, either. -
My game center won't load and shows up blank when I try to open it. I've already closed all of my apps and restarted it and it still won't work. Is their anyway to fix it without restoring it and starting over??
Try:
- Reset the iOS device. Nothing will be lost
Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
least ten seconds, until the Apple logo appears.
- sign out and the sign back into Game Center
- Reset all settings
Go to Settings > General > Reset and tap Reset All Settings.
All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
- Restore from backup. See:
iOS: Back up and restore your iOS device with iCloud or iTunes
- Restore to factory settings/new iOS device. -
Game center stuck on loading mode
Game Center is stuck on loading mode. Bought Jenga app and now can't play app because Game Center won't load.
Recently i've found the solution to this problem. Go to Settings, General, Reset and choose Reset network settings. And bingo!
-
AS 2.0 Loader component question
I have a site that has a gallery with 40 images, takes a long
time to load so I need to find the best way to correct. The files
that load manually now are movieclips that play in 10 second frames
in their own timeline with an alpha effect on each all the jpgs and
other files are in the main fla which is huge because of this. I
was going to use the loader component but I see you can only use
for .jpgs and I can't put the effect on jpgs, other obvious way is
using loadMovie but then I have to convert all mc's to separate
swfs. Before I go that route is there another way to do this?
rderfI have a site that has a gallery with 40 images, takes a long
time to load so I need to find the best way to correct. The files
that load manually now are movieclips that play in 10 second frames
in their own timeline with an alpha effect on each all the jpgs and
other files are in the main fla which is huge because of this. I
was going to use the loader component but I see you can only use
for .jpgs and I can't put the effect on jpgs, other obvious way is
using loadMovie but then I have to convert all mc's to separate
swfs. Before I go that route is there another way to do this?
rderf
Maybe you are looking for
-
Getdeviceip??? cant get it to work
Whenever, it get to the getDeviceList, it always said that these two line below are wrong. xmlhttp.Send(); xmlDoc.loadXML(xmlhttp.responseText); what wrong with them??? Here is the code of the function getDeviceList() function getDeviceList(callManag
-
Album artwork does not share?
I have a MacMini hooked up to my living room television. Front row will not share album artwork from my iMac. The music can be shared, but without the album artwork. What is the fix?
-
How to Get Google Play Services on BlackBerry OS10 - Z30
There are Many Google Apps that are not running on BlackBerry OS10 asking for Google Play Services - How to Get Them ? Thanks Regards Eree - Follow me on Twitter - Facebook - Google+ For More visit My Blog
-
I have an iPad 3 and the left side touchscreen dont works, how can i fix it ?
my iPad dont works it left side touchscreen, how can i fix it ?
-
Mac Pro end of life in Europe?
My local reseller has emailed me to inform me that the Mac Pro will no longer be availabe in the EU from March. Is this for real or an early April Fool? Message was... Here's the official word from Apple: As of March 1, 2013, Apple will no longer sel