Topic: Background image reload and Link on background image

Hi!

I moved mBkgnd_mc from the StageManager to ImageArea so I can use an external logo and its always shown above the image, at a relative position to the images top left corner. Its redrawn with every image.

public function showImage(imgIndex:Number):Void{

...

mBkgnd_mc._x = mImages[mCurrentImageIndex].imageX;
mBkgnd_mc._y = mImages[mCurrentImageIndex].imageY - 65; // the logo is 65 pixel high.


But I have a problem. When the next image is smaller then the current, than the logo appears on its new position, before the current image disappears. It looks ugly. If the logo has to be redrawn then how can I know that the new image is appeared?


My second problem is very simple, but because I am beginner with Flash I dont know how to solve it. I would like to have a link on this logo. I read many websites, the help in Flash, etc. but dont know how to do it. The best thing I could come up is this, but doesn't work (at least it doesnt give any errors. smile))

if (mXMLManager.backgroundImagePath != null){
    ...
    mBkgnd_mc.onMouseUp.getURL("http://myurl.net", "_blank");


Thanks for your help,
w8.

Re: Background image reload and Link on background image

Good idea!  Haven't tried this, but you could have the background image become visible, after the image is loaded, something like mBkgnd_mc._visible=true:   in image.as around line 106

and in the second question - try
mBkgnd_mc.onRelease.getURL("http://myurl.net", "_blank");

Richard

in order to better assist you, please provide a url, relevant code and details about your problem.
Thanks!

Re: Background image reload and Link on background image

Flash ho wrote:

Good idea!  Haven't tried this, but you could have the background image become visible, after the image is loaded, something like mBkgnd_mc._visible=true:   in image.as around line 106

and in the second question - try
mBkgnd_mc.onRelease.getURL("http://myurl.net", "_blank");

I am still drinking my firs coffee... smile

"mBkgnd_mc._visible=true" 
I understand this, but dont know which function to put into. Is it onLoadInit or LoadImage?


"mBkgnd_mc.onRelease.getURL"
And again: where to use this?

This my whole mBkgnd thing:
if (mXMLManager.backgroundImagePath != null){
            mBkgnd_mc = mClip_mc.createEmptyMovieClip("mcBkgnd",mClip_mc.getNextHighestDepth());
            var loader_mcl:MovieClipLoader = new MovieClipLoader();
            loader_mcl.addListener(this);       
            loader_mcl.loadClip(mXMLManager.backgroundImagePath,mBkgnd_mc);   
            mBkgnd_mc.onRelease.getURL("http://myurl.net", "_blank");
        }   

And it is in function init(target:MovieClip) in ImageArea.as. And there this kind of statement is not permitted in a class definition. (I am not so wise, just read it in the Output window... smile )

Thanks for your help,
w8.

Re: Background image reload and Link on background image

I'll try a test, before I confuse you more.  smile

Richard

in order to better assist you, please provide a url, relevant code and details about your problem.
Thanks!

Re: Background image reload and Link on background image

Flash ho wrote:

I'll try a test, before I confuse you more.  smile

Thanks!

Re: Background image reload and Link on background image

I have to finish with this gallery by friday, so I try and try different things.

if (mXMLManager.backgroundImagePath != null){
            mBkgnd_mc = mClip_mc.createEmptyMovieClip("mcBkgnd",mClip_mc.getNextHighestDepth());
            var loader_mcl:MovieClipLoader = new MovieClipLoader();
            loader_mcl.addListener(this);       
            loader_mcl.loadClip(mXMLManager.backgroundImagePath,mBkgnd_mc);   
            mBkgnd_mc.addEventListener("click", LogoClickListener);
        }   

As you can see I tried to create an EventListener:

    function LogoClickListener(evt:Object):Void {
    var targetUrl:String = "http://myurl.net";
    getURL(targetUrl);
    }

I copied this from the HELP in Flash 8, and -surprise- it doesnt do anything. No error codes, nothing wrong, but nothing happens as  I click the background image.

I would appreciate any kind of help!

thanks,
w8.

Re: Background image reload and Link on background image

Instead of using the background image mc, I would create a new mc in the Image class that will hold your logo.

Add the logo graphic to the library, give it linkage name "myLogo"

In the Image class add this in the variable declarations

private var mLogo_mc:MovieClip;

add this at the end of the Image() function:

mLogo_mc = mClip_mc.loadMovie("myLogo","loader",mClip_mc.getNextHighestDepth());    
Felix Turner
SimpleViewer Support Team.

Re: Background image reload and Link on background image

Felix,

Thanks for the idea, but I have a reason to use the Background image mc: this way the background image stays an external file and can be changed later!

If I create this mLogo_mc how can I give a link to it? My goal is not just to show the logo above every image, but to put a "mailto:" link!

Check it out:
http://feszek.pte.hu/~baro/album/

thanks,
w8

Re: Background image reload and Link on background image

Just asking if you might have any solution...

Re: Background image reload and Link on background image

Because I couldnt find a way to add link to the logo, I modified the "Download link".  It isnt what I wanted, but works.

I am still working on the background image loading problem: if I am going to have fixed sized pictures in an album, than it wont cause a problem. BUT!  If I resize the window, than the picture is not redrawn, just when I click for the next image.

I am not a programmer, or a flash guru, but after working on this project so long I have a big rispect for all of you! smile

w8.