WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Site Design > Flash Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Flash Discussion Forum Flash design presents a limitless number of possibilities for your sites and designs. Discuss your Flash ideas, questions and issues here.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-22-2003, 08:49 AM
Bradshaw Bradshaw is offline
WebProWorld New Member
 

Join Date: Aug 2003
Posts: 19
Bradshaw RepRank 0
Default !!and action...script!!

I have set up a movie which is to act as part of an interactive map of a building. There are four buttons which when you click upon them will zoom in on a different room (4 rooms)My problem is I want the person to be able to be zoomed in on room1 but then be able to click on room2 and have the image zoom out and then zoom in again to room2 This can be done easily if the viewer is clicking through the rooms in order 1,2,3,4 chances are they will jump around and go back and forth. I want the buttons to act in the following way...

Example (we are in room1)

upon clicking room 3
zoom out of room1 to original main plan
then zoom in on room 3

My idea is to set an actionscript so that when I click on any room, the room that I am currently plays a zoom out (5-10 frames) and after playing this set number of frames goes to the frame designated for the start of zooming in on room 3.

If that makes any sense to you and you have some ideas of what kind of script I should use please help. I am fairly new to this actionscript stuff but can pick things up quick.

Thanks in anticipation

Dan
Reply With Quote
  #2 (permalink)  
Old 10-22-2003, 09:43 AM
Sualdam Sualdam is offline
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Posts: 1,087
Sualdam RepRank 0
Default

The way I'd do it is to have each room a separate movie (if you start trying to do complex stuff on a single timeline it gets unwieldy).

Then, depending on whether each movie is zoomed in or out, set a variable to act as a flag: r1z=1 for room 1 zoomed in and r1z=0 for zoomed out, etc.

You could then use an if/then structure in each movie(or the switch structure) to decide what to do.

Does that make sense?
__________________
Sualdam
Reply With Quote
  #3 (permalink)  
Old 10-22-2003, 10:11 AM
Bradshaw Bradshaw is offline
WebProWorld New Member
 

Join Date: Aug 2003
Posts: 19
Bradshaw RepRank 0
Default

Many thanks,

It doesn't all make sense but it gives me more of an idea of what to go on and not to create something to complex in the one timeline.

Look out for the site when I submit it for review...

Cheers

Dan
Reply With Quote
  #4 (permalink)  
Old 10-22-2003, 10:13 AM
Sualdam Sualdam is offline
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Posts: 1,087
Sualdam RepRank 0
Default

If you want, when I get home tonight I can do a demo for you.

I won't unless you ask for it - you seem to want to go for it yourself, which is fine.
__________________
Sualdam
Reply With Quote
  #5 (permalink)  
Old 10-22-2003, 11:29 AM
Bradshaw Bradshaw is offline
WebProWorld New Member
 

Join Date: Aug 2003
Posts: 19
Bradshaw RepRank 0
Default

That would be cool, though it might be easier if you can answer this question

can I set a movie playing for say 5 frames (not to a specified frame) and then for it to goto another specified frame. I am trying to make movie zoom1 play (then stop at a specificed point in the movie (can do this) and then have a button that when clicked will continue playing the rest of the movie and then goto a new movie as specified

click button1
play movie1- stop...

click button2,3 or 4
restart current movie (for 5-10 frames)
go to movie2, 3 or 4
play movie2, 3 or 4 stop...

and so on...

Thanks

dan
Reply With Quote
  #6 (permalink)  
Old 10-22-2003, 01:13 PM
Sualdam Sualdam is offline
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Posts: 1,087
Sualdam RepRank 0
Default

What you need to do is have a button/keframe on frame 1 then have another keyframe on say frame 5.

That means you effectively have two separate buttons that you can apply actions to.

You'll have a stop() action on frames 1 and 5 as well so that the playhead stops in those places.

On each button put this code:
Code:
on(release){
play();
}
Now test it.

It will start frozen on frame 1 because of the stop() action.

Click the button and the playhead will now play up until frame 5, then it stops again.

Click the button again and the playhead continues, and jumps back to frame 1 when it reaches the end of the movie unless you have another stop action to prevent it.

I'll post a sample later.

(Note: In the simple example above you don't necessarily have to have two keyframes in the button layer because the code is the same - but in your real situation you'll want different code probably, so you'll need the two keyframes then).
__________________
Sualdam
Reply With Quote
  #7 (permalink)  
Old 10-22-2003, 02:08 PM
voodooboy voodooboy is offline
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Seattle, WA USA
Posts: 962
voodooboy RepRank 0
Default

Would it not be just as easy, since you have to do it anyway, create a seperate voom-out movie clip for each floor/room. Then set the button with a GoToand Play function for that movie selecting a specific frame set? Example. You are in scene one within room one (stop function on say frame 125), you then have the voom-out clip on frames 135, 145, and 155. The viewer clicks on button 2 and the movie jumps to frame 135 and plays the voom-out then loads scene 2 for rooom 2. If they clicked on button 3 the movie would jump to frame 145 and zoom out and load scene 3 for room 3. Does that make sense?

I think that would do what you want without a lot of scripting.
__________________
Scott Brinkerhoff - Art of Zen Studios
Web Design I Design Monk
© 2000-forever - All rights reserved by me - SO THERE!!
Reply With Quote
  #8 (permalink)  
Old 10-22-2003, 04:19 PM
Sualdam Sualdam is offline
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Posts: 1,087
Sualdam RepRank 0
Default

If you haven't sorted it out, this might help. It uses the switch statement, which is an elegant way of handling this.

You can see the example here (imagine the coloured squares on top of each other, and each one correpsonding to your zoom in/zoom out scenario):

Example Movie

If you want the FLA, it is here:

The FLA

(Incidentally, there is a condition in my example where two movies change at the same time, but you get the idea :))
__________________
Sualdam
Reply With Quote
  #9 (permalink)  
Old 10-23-2003, 05:59 AM
Bradshaw Bradshaw is offline
WebProWorld New Member
 

Join Date: Aug 2003
Posts: 19
Bradshaw RepRank 0
Default

Thanks for all your help,

I will try these ideas out. Sualdam I like how yours works, though I think mine would be a reversed instead of when clicked it would enlarge as oppose to reduce in size.

I think I understand both and willpost the result for you to look at.

Cheers

Dan
Reply With Quote
  #10 (permalink)  
Old 10-31-2003, 06:50 PM
mtheory's Avatar
mtheory mtheory is offline
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Connecticut, US
Posts: 620
mtheory RepRank 1
Default Zoom

Zoom effect is much better accomplished with actionscript.

Example:
http://www.localshoppernetwork.com/zoomexp/

This is a work in progress that will ultimately be incorporated into an Abobe Photoshop Web Gallery Template for a Photographer.
Reply With Quote
Reply

  WebProWorld > Site Design > Flash Discussion Forum
Tags: actionscript



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Search Engine Friendly URLs by vBSEO 3.0.0