Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 19th, 2001, 06:26 PM
mbritton72 mbritton72 is offline
Shrill Digital God
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: Raleigh, NC
Posts: 64 mbritton72 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 32 m
Reputation Power: 7
Question movie loads when _y is at a specific position?

I need some advice on the best way to use a function to detect a clip's position while it is moving, and execute a loadMovie to a target when the desired _y position is reached.

I have a function on the timeline and movie clips with onClipEvents on each keyframe (or 'page' in the context of the site) that call this function. The clips pass a variable to the function which is supposed to determine the right content movie to load when the condition is met:

onClipEvent (load) {
category = "home";
_root.moveMe(category);
}

Function moveMe itself looks like this:

function moveme(category) {

currenty = getProperty("_root.presentation", _y);
speed = 5
toLoad = category;
if (toLoad == "home") {
if (currenty<20 && currenty>-20) {
loadMovie ("home.swf", "_root.content");
}
}
else if (toLoad == "biography") {
if (currenty<-321 && currenty>-361) {
loadMovie ("biography.swf", "_root.content");
}
}
else if (toLoad == "bookings") {
if (currenty<-662 && currenty>-702) {
loadMovie ("bookings.swf", "_root.content");
}
}
else if (toLoad == "contact") {
if (currenty<-1000 && currenty>-1043) {
loadMovie ("contact.swf", "_root.content");
}
}
else if (toLoad == "discography") {
if (currenty<-1344 && currenty>-1384) {
loadMovie ("discography.swf", "_root.content");
}
}
else if (toLoad == "journal") {
if (currenty<-1685 && currenty>-1725) {
loadMovie ("journal.swf", "_root.content");
}
}
else if (toLoad == "tracks") {
if (currenty<-2026 && currenty>-2066) {
loadMovie ("tracks.swf", "_root.content");
}
}
}

Problem: the function seems to be loading the wrong pages when it's called. It doesn't wait for the sliding clip to reach the desired _y position before loading the movies. When the sliding clip reaches the desired position, the movies that are loaded will disappear and there will be nothing loaded. It looks like the function is doing this when the sliding clip reaches the desired _y position for each possibility in the logic.

Do I need a for loop?

What's happening? I'm at my wit's end!!!!
__________________
I'm not impatient, I just have a low tolerance for boredom.

Reply With Quote
  #2  
Old December 31st, 2001, 02:00 PM
mbritton72 mbritton72 is offline
Shrill Digital God
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: Raleigh, NC
Posts: 64 mbritton72 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 32 m
Reputation Power: 7
Solution

// This function detects the _y position
// of a movie clip, and loads a movie
// into a target. I call it with onClipEvents
// on the scrolling object

category = "home";
load = "";
function trigger (movieclip, category) {
currenty = Number(getProperty(movieclip, _y));
// home
if (currenty>-35 && currenty>=-15 && category == "home") {
if (load == "" || load != category) {
loadMovie (category+".swf", "_root.content");
load = category;
}
// biography
} else if (currenty<=-325 && currenty>-357 && category == "biography") {
if (load == "" || load != category) {
loadMovie (category+".swf", "_root.content");
load = category;
}
// bookings
} else if (currenty>-698 && currenty<-666 && category == "bookings") {
if (load == "" || load != category) {
loadMovie (category+".swf", "_root.content");
load = category;
}
// contact
} else if (currenty>-1039 && currenty<-1007 && category == "contact") {
if (load == "" || load != category) {
loadMovie (category+".swf", "_root.content");
load = category;
}
// discography
} else if (currenty>-1380 && currenty<-1348 && category == "discography") {
if (load == "" || load != category) {
loadMovie (category+".swf", "_root.content");
load = category;
}
// journal
} else if (currenty>-1725 && currenty<-1685 && category == "journal") {
if (load == "" || load != category) {
loadMovie (category+".swf", "_root.content");
load = category;
}
// tracks
} else if (currenty>-2066 && currenty<-2026 && category == "tracks") {
if (load == "" || load != category) {
loadMovie (category+".swf", "_root.content");
load = category;
}
}
}

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > movie loads when _y is at a specific position?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway