Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Site Design / July 2008



Tip: Looking for answers? Try searching our database.

Please help a new guy, having problems with random imagery

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JohnnyBighead - 02 Jul 2008 21:05 GMT
Hey everybody hows it going?  Any help you could give me would be greatly
appreciated!  

Here is my problem.  I am working off a template and have been able to do
everything I want so far but ive run into a problem.  Check my site to follow
along  http://www.shinemediahouse.com/.   Whenever the user clicks on About,
Services or Contact a random image appears along with the background on the
corresponding page.  I need to be able to link it to a specific image.  I found
the action for the random sequence and it reads as follow,
(_root.link !== 3) {
    _root.pic_num = (Math.ceil(Math.random()*105));

Anybody know a way to fix my problem? It probably is really simple I just have
no clue.

Also, is there a way to have the animation centered in the browser window?

Any help would be greatly appreciated!!!
Rob Dillon - 03 Jul 2008 14:09 GMT
Is there an "if" in front of "(_root.link !== 3) {"? If that's the case then
you probably want to get rid of that if condition. Then just use the line below
and specify the actual .pic_num that you want to use. as in:

_root.pic_num = 34;

for instance.

There is probably a line of code below the ones that you quoted that resolves
the value of pic_num into an actual image name. I'm guessing that there's an
array of images somewhere in the movie, probably at the root level when the
movie begins.

The answer could be completely different as it is very difficult to diagnose
template problems.
JohnnyBighead - 03 Jul 2008 22:09 GMT
This is a perfect answer.  It did have an if in front and i am now able to
specify what number image from an array of images.  Now, is there a way to
specify different photos for the three different buttons?  

I am thinking that is what the

if (_root.link !== 3)

piece is about.

Any thing would be great!!!

Thanks!
Rob Dillon - 04 Jul 2008 16:03 GMT
Yes, it would help to see the original file. The individual buttons can be specified in any number ways and its impossible to know what might be going on in the code without seeing it.
JohnnyBighead - 04 Jul 2008 19:45 GMT
thanks so much for your willingness to help.  I have posted it at megaupload.

http://www.megaupload.com/?d=VALDL01V

let me know what you think!
Rob Dillon - 05 Jul 2008 16:45 GMT
Like most templates, this one is made up mostly of junk actionscript. This
makes any sort of change very difficult and time consuming. I spent about an
hour struggling through this movie, trying to find some semblance order. There
is a movieClip, "2_gall_gall1_main_pic_change6 copy", that holds all of the
images that are used in the movie. The actual frame to be shown is held in a
variable, "pic_num". The value for this variable is set in a number of places
in the movie. One of these places is on the main timeline in the menu layer, at
the first frame where the movieClip "menu" begins to play. The action is
attached to the movieClip. In this code, you could set new values for the image
to be shown for each menu selection. I have no idea what effect this might have
on the rest of the movie.
JohnnyBighead - 05 Jul 2008 18:17 GMT
thanks so much for your time!!  

it really is amazing you would spend it trying to help me out.  I will look
through and see if i can figure out where you are talking about and report
back.  this template really has been confusing to me but we are getting there.  

Thanks again!
JohnnyBighead - 05 Jul 2008 18:34 GMT
I currently have the action on layer 14, frame 96 as saying:

if (_root.link !== 3) {
    _root.pic_num = 120;
}

this allows me to set the background for the three buttons as the image from
"2_gall_gall1_main_pic_change6 copy" frame 120.  

How would i specify each one?  I know you said i could set new values but what
would that code say?

if (_root.link = 1) {
    _root.pic_num = 120;
}
 
if (_root.link = 2) {
    _root.pic_num = 121;
}

if (_root.link = 3) {
    _root.pic_num = 122;
}
     
I know that wouldnt be it, but would it be something close to that?  

Thanks!
JohnnyBighead - 05 Jul 2008 21:42 GMT
Also, will i be able to add a video exported from after effects into my
galleries?  I would like them to work the same way as the images but i am not
sure it is possible.  any guidance on this would be greatly appreciated!
Rob Dillon - 06 Jul 2008 16:57 GMT
This is the code that I was referring to:

onClipEvent (enterFrame) {
    _parent.gal2_1.gotoAndStop(_root.pic_num);
    _parent.gal2_2.gotoAndStop(_root.pic_num);
    _parent.gal2_3.gotoAndStop(_root.pic_num);
    _parent.gal2_4.gotoAndStop(_root.pic_num);
}

This shows up in various places attached to movieClips.
There is also this code which is attached to each of the menu buttons:

onClipEvent (load) {
    num = 1;
}
on (rollOver) {
    this.gotoAndPlay("s1");
}
on (releaseOutside, rollOut) {
    this.gotoAndPlay("s2");
}
on (release) {
    _root.animation = 0;
    _root.link_prev = _root.link;
    _root.link = num;
    _root.play();
}

Even though there is no reference to _root.pic_num, you could set the value
here for each of the buttons.
JohnnyBighead - 06 Jul 2008 19:44 GMT
that is great information!  

if i was to put in a value and reference for _root.pic_num where would it go
and how would it relate to the action on layer 14 frame 96?  

Any ideas?  

Currently that action is saying:

if (_root.link !== 3) {
_root.pic_num = 120;
}

and it is giving image 120 from that array of images we talked about before
Rob Dillon - 07 Jul 2008 14:17 GMT
As I said earlier, I have no idea where the value for pic_num is being set. And
so, I can't tell if the value for that variable is able to be set to a unique
value for each of the menu selections. It may be possible and it may not. I
gave you a couple of places in the code where I thought that you might be able
to inject a change and see if that will effect the image that is shown for the
individual menu item selections.

I would comment out that if condition on frame 96 and add in a new value for
pic_num in the onRelease function that I mentioned above. Try that and see if
you make any headway.

The code in this movie is extremely convoluted and, even using search for key
words, it is frustrating and time consuming to try and track down the
methodology of this movie. Add in that there are no comments anywhere and you
have a very frustrating experience.

Did you get any information or explanation for customizing this template when
you got it? Have you contacted the author for information or guidance?
JohnnyBighead - 08 Jul 2008 21:54 GMT
thanks so much for your help!  i think i have it close enough to what i want to
call it a day.  

i still need to address the video issue but thats a whole different beast.

thanks for all your help and i hope i can be helpful around here in the future!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.