# Loading JPEGs from a textfile

**URL:** <https://forum.kirupa.com/t/loading-jpegs-from-a-textfile/29644>\
**Category:** flash\
**Created:** [August 28, 2003, 11:55pm UTC](https://forum.kirupa.com/t/loading-jpegs-from-a-textfile/29644 "2003-08-28T23:55:34Z")\
**Posts on this page:** 16\
**Page:** 2

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 30, 2003, 9:04am UTC](https://forum.kirupa.com/t/loading-jpegs-from-a-textfile/29644/21 "2003-08-30T09:04:27Z")

</div>

did you write

www.calibraclub.it/public/imaflash/text1.fla ?

and so on for all the files ?

This should work …

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 30, 2003, 9:06am UTC](https://forum.kirupa.com/t/loading-jpegs-from-a-textfile/29644/22 "2003-08-30T09:06:08Z")

</div>

Ah, now it does !? Weird … Anyways. I’m having a look at it now 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 30, 2003, 9:15am UTC](https://forum.kirupa.com/t/loading-jpegs-from-a-textfile/29644/23 "2003-08-30T09:15:30Z")

</div>

argh my computer keeps crashing ! Sorry I can’t check it right now, I’ll check it downstairs.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 30, 2003, 12:32pm UTC](https://forum.kirupa.com/t/loading-jpegs-from-a-textfile/29644/24 "2003-08-30T12:32:09Z")

</div>

I could only download the text1.fla file … Can you send them through e-mail ? voetsjoeba_at_[hotmail.com](http://hotmail.com)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 30, 2003, 1:04pm UTC](https://forum.kirupa.com/t/loading-jpegs-from-a-textfile/29644/25 "2003-08-30T13:04:46Z")

</div>

Done … check that out !!!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 30, 2003, 2:39pm UTC](https://forum.kirupa.com/t/loading-jpegs-from-a-textfile/29644/26 "2003-08-30T14:39:40Z")

</div>

have you found them in your mailbox ?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 30, 2003, 6:51pm UTC](https://forum.kirupa.com/t/loading-jpegs-from-a-textfile/29644/27 "2003-08-30T18:51:42Z")

</div>

Yes I have, sorry for taking so long. I had some problems with my Internet connection. Replace varImage1=text1.swf at the end of your textfiles with varImage1=ciccio.jpg& and it should work =) There seemed to be some problems with the ciccio.jpg file. I couldn’t open it in PS for example. If it still doesn’t work, try loading another image.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 31, 2003, 12:04am UTC](https://forum.kirupa.com/t/loading-jpegs-from-a-textfile/29644/28 "2003-08-31T00:04:16Z")

</div>

Thank you a lot. I have changed my jpg and now everything is fine …  
Just another pair of questions :  
n°1 is it possible to reduce the image to a specified size only by one dimension ( letting the other in proportion ?) i.e., I load an image that is 500x250 and want it to be width=50, so height will be 25 without me calculating it ?

n°2 is it possible to link to an image to an external link, and load it from the textfile ? i.e, varLink1=http://www.calibraclub.it which is attached to varImage1 image onRelease …

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 31, 2003, 7:22am UTC](https://forum.kirupa.com/t/loading-jpegs-from-a-textfile/29644/29 "2003-08-31T07:22:23Z")

</div>

1: Why can’t you just set it manually. That’d be a lot easier.

2: I’m not sure what you mean ?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 31, 2003, 10:19am UTC](https://forum.kirupa.com/t/loading-jpegs-from-a-textfile/29644/30 "2003-08-31T10:19:02Z")

</div>

eh eh eh …

1. cause it’s a nice scripting challenge, I think …

2. ok. In my textfile.txt I got my variables : varTitle, varText, VarImage1 AND VarLink1.  
What I need is that, on my swf, clicking on the image loaded from varImage1 variable, I can open an url in another windows

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 31, 2003, 10:43am UTC](https://forum.kirupa.com/t/loading-jpegs-from-a-textfile/29644/31 "2003-08-31T10:43:05Z")

</div>

1. I’m not going to script that for you just if you think it’s a nice challenge. You should try it yourself then =).

2. You’d have to make an invisible button for that (a button with only a hit state, and with the registration point the same as the the movieclip image has), and have that button set to the same x, y, \_width and \_height values and then link that button. Something like this:

[AS]  
\_root.invbutton.\_height = \_root.container.image.\_height  
\_root.invbutton.\_width = \_root.container.image.\_width  
\_root.invbutton.\_x = \_root.container.image.\_x  
\_root.invbutton.\_y = \_root.container.image.\_y  
\_root.invbutton.onRelease = function(){  
getURL(“[http://www.site.com/whatever.html","\_blank](http://www.site.com/whatever.html%22,%22_blank)”)  
}  
[/AS]

Something like that.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 31, 2003, 11:07am UTC](https://forum.kirupa.com/t/loading-jpegs-from-a-textfile/29644/32 "2003-08-31T11:07:53Z")

</div>

1. ok,ok it was not a request to code for me … I’m just learning to use Actionscript and saw that you are abel to script… So my was just an help request to help me to understand and learn … as you rcan ead in the email I sent you … hope there’s been no misunderstanding of my request…

2. Ok, I thought about it before your answer, and figured something like that… but what if I want to take the link from the textfile ? Have I to use a code like the one for the image and then subtitute it to the "http:// … " ?

Thanks a lot …

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 31, 2003, 11:20am UTC](https://forum.kirupa.com/t/loading-jpegs-from-a-textfile/29644/33 "2003-08-31T11:20:35Z")

</div>

1. _Note to self: Click that mail icon more often_ I’m always willing to help =) I’ll check yer e-mail right away.

2. Lol, I forgot the link had to be loaded from the txtfile, sry 😛 Something like this would do it:

[AS]  
on(release){  
\_root.testi.gotoAndStop(2);  
lv = new loadVars();  
lv.onLoad = function(success){  
if (success){  
\_root.textboxes.textF1.html = 1  
\_root.textboxes.textF2.html = 1  
\_root.container.image.loadMovie(this.varImage1)  
\_root.textboxes.textF1.htmlText = this.varTitle  
\_root.textboxes.textF2.htmlText = this.varText  
} else {  
trace(“Failed to load textfile”);  
}  
}  
lv.load(“textfile.txt”)  
\_root.invbutton.\_height = \_root.container.image.\_height  
\_root.invbutton.\_width = \_root.container.image.\_width  
\_root.invbutton.\_x = \_root.container.image.\_x  
\_root.invbutton.\_y = \_root.container.image.\_y  
\_root.invbutton.onRelease = function(){  
getURL(lv.VarLink1,"\_blank")  
}  
}

[/AS]

Sorry for taking so long, but I’m frustrated (not by you, personal stuff) and my connection just fell to 56k Ⓜ

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 31, 2003, 11:29am UTC](https://forum.kirupa.com/t/loading-jpegs-from-a-textfile/29644/34 "2003-08-31T11:29:44Z")

</div>

Don’t worry about time … it’s a luck I found you … eh eh eh …

sorry, but my English is not so good to understand what you wrote on 1) …  
but what i told about th email was referred to the 'Do you know where I can learn scripting well ? ’ i wrote in the email with attachments …

Thanks for what you’re doing, I appreciate it a lot !!!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 31, 2003, 11:32am UTC](https://forum.kirupa.com/t/loading-jpegs-from-a-textfile/29644/35 "2003-08-31T11:32:30Z")

</div>

I thought you sent me another e-mail and I didn’t notice yet, so I considered I had to check my e-mails more often =) So did it work out for you ?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 1, 2003, 1:32am UTC](https://forum.kirupa.com/t/loading-jpegs-from-a-textfile/29644/36 "2003-09-01T01:32:28Z")

</div>

I tried it, but I was thinkin to other thing, as my sister has broken her leg today and I’ve spent some time in hospital … things that happens.  
anyway, I have put the code in the first frame as you saw in my fla … the varLink1 in my introduzione.txt, as varLink1=http://www.calibraclub.it&

But everything is like before … it loads the text, it loads the images, but no link associated … the code is this :  
(applied to the first frame action of the main timeline)

lv = new loadVars();  
lv.onLoad = function(success){  
if (success){  
\_root.textboxes.textF1.html = 1  
\_root.textboxes.textF2.html = 1  
\_root.container.image.loadMovie(this.varImage1)  
\_root.textboxes.textF1.htmlText = this.varTitle  
\_root.textboxes.textF2.htmlText = this.varText  
} else {  
trace(“Failed to load textfile”);  
}  
}  
lv.load(“introduzione.txt”)  
\_root.invbutton.\_height = \_root.container.image.\_height  
\_root.invbutton.\_width = \_root.container.image.\_width  
\_root.invbutton.\_x = \_root.container.image.\_x  
\_root.invbutton.\_y = \_root.container.image.\_y  
\_root.invbutton.onRelease = function(){  
getURL(lv.VarLink1,"\_blank")  
}

Anything wrong ?? … tnx

[Previous page](https://forum.kirupa.com/t/loading-jpegs-from-a-textfile/29644.md?page=1)
