Groups | Blog | Home
all groups > flash (macromedia) > may 2004 >

flash (macromedia) : how to make a loaded jpeg a link to another page?...



seb
5/21/2004 9:50:55 PM
Hi all
I have a movie that loads jpegs into a movieClip Holder.
I'd like each loaded jpeg to be a link (as if it were a button) that
opens a new window. (the new window will be an html page showing a
larger version of that image).
How is this possible, if it is?...

here's the code i use to load the jpegs, when you click on a thumbnail:

on (release) {
_root.stage1.createEmptyMovieClip("imageMc1", 1);
_root.stage1.imageMc1.createEmptyMovieClip("holder1", 1);
_root.stage1.imageMc1.holder1.loadMovie("images/malermeister1/medium/page4.jpg");

_root.stage1.imageMc1.onEnterFrame = function() {
if(this.holder1.getBytesLoaded()/this.holder1.getBytesTotal() == 1) {
this._x = -this._width/2;
this._y = -this._height/2;
delete this.onEnterFrame;
}
}

Engan
5/22/2004 9:32:03 AM
Hi!

Why would u use another .html file when u can target the picture in the same
movie with the loadmovie u already have used?

Here is what I would do:

loadMovie("whatever your movie is called", "the url to the html file");

it might work haven't tried it yet but it should be something like that!!!


Engan
5/22/2004 9:42:36 AM
sry wrong:

use the getUrl("whateverurUrlIs.html") make sure the thumb is clickable with
the on() handler then the .html file can include the .swf file for the larger
picture with the OBJECT tags.....
seb
5/22/2004 1:00:45 PM
sry i don't get it.
how do i apply this code (or any code) to a jpg that is not yet loaded?

The problem is:
The same movieClip holder is going to load/unload many different jpegs
one after another in the same location, but each jpeg must link to a
different page (open a different URL when clicked).

My guess is I'm looking for something that will set the url as a
variable, that i can apply to the mcHolder, like:

on (release) {
getURL("?.html", "target=_blank")
}
where "?" will be a variable returning the name of whichever jpeg is
currently loaded, minus the .jpeg extension.

If that makes any sense?

[quoted text, click to view]
pazzoboy
5/23/2004 4:14:15 AM
Hmmm...just answered this for someone else. Popular effect I guess: You have a
rectangle movieclip with instance name mc_holder. In a layer above that, you
have a filled shape with instance name invisiButton...it covers the entire area
of mc_holder, and its alpha is set to zero. On your thumbnail called
smallFirstPic, put this:

on(release){
unloadMovie(_root.mc_holder);
loadMovie("bigFirstPic.jpg",_root.mc_holder);
_root.invisiButton.onRelease=function(){
getURL("http://www.crayola.com","_blank");
}
}

Do this for each pic. The only thing you need to change is the loadMovie
line, and the getURL line.
AddThis Social Bookmark Button