loading data into slide content page

  • fifin04
  • Student
  • Student
  • fifin04
  • Posts: 70

Post 3+ Months Ago

Hi....

I just d/l the fla source from kirupa and then what I want to do is I wanna load the data from dtbase using php into flash.meaning that after it's finishing sliding the page then it'll load the data using loadvars..and I want everytime I slide to that particular page it'll load the data....hope you guys clear about it...

this is the code in the fla

Code: [ Select ]

var currentPosition:Number = contentHold.content1._x;
var startFlag:Boolean = false;


function menuSlide(input:MovieClip) {
    if (startFlag == false) {        
        startFlag = true;
        var finalDestination:Number = input._x;
        var distanceMoved:Number = 0;
        var distanceToMove:Number = Math.abs(finalDestination-currentPosition);
        var finalSpeed:Number = .3;
        var currentSpeed:Number = 0;
        var dir:Number = 1;
        
        if (currentPosition<=finalDestination) {
            dir = -1;
        } else if (currentPosition>finalDestination) {
            dir = 1;
        }
        
        this.onEnterFrame = function() {
            currentSpeed = Math.round((distanceToMove-distanceMoved+1)*finalSpeed);
            distanceMoved += currentSpeed;
            contentHold._x += dir*currentSpeed;
            if (Math.abs(distanceMoved-distanceToMove)<=1) {
                contentHold._x = maskMovie._x-currentPosition+dir*distanceToMove;
                currentPosition = input._x;
                startFlag = false;
                delete this.onEnterFrame;
                trace("done slide");
                //I guess this portion I have to load the data using loadvars object
            }
        };
    }
};

var contentArr:Array = [contentHold.content1,contentHold.content2,contentHold.content3,contentHold.content4,contentHold.content5];

for(var i=0;i<5;i++){
    this["b"+i].ivar = i;
    this["b"+i].onPress = function(){
        menuSlide(contentArr[this.ivar]);
    }
}
  1. var currentPosition:Number = contentHold.content1._x;
  2. var startFlag:Boolean = false;
  3. function menuSlide(input:MovieClip) {
  4.     if (startFlag == false) {        
  5.         startFlag = true;
  6.         var finalDestination:Number = input._x;
  7.         var distanceMoved:Number = 0;
  8.         var distanceToMove:Number = Math.abs(finalDestination-currentPosition);
  9.         var finalSpeed:Number = .3;
  10.         var currentSpeed:Number = 0;
  11.         var dir:Number = 1;
  12.         
  13.         if (currentPosition<=finalDestination) {
  14.             dir = -1;
  15.         } else if (currentPosition>finalDestination) {
  16.             dir = 1;
  17.         }
  18.         
  19.         this.onEnterFrame = function() {
  20.             currentSpeed = Math.round((distanceToMove-distanceMoved+1)*finalSpeed);
  21.             distanceMoved += currentSpeed;
  22.             contentHold._x += dir*currentSpeed;
  23.             if (Math.abs(distanceMoved-distanceToMove)<=1) {
  24.                 contentHold._x = maskMovie._x-currentPosition+dir*distanceToMove;
  25.                 currentPosition = input._x;
  26.                 startFlag = false;
  27.                 delete this.onEnterFrame;
  28.                 trace("done slide");
  29.                 //I guess this portion I have to load the data using loadvars object
  30.             }
  31.         };
  32.     }
  33. };
  34. var contentArr:Array = [contentHold.content1,contentHold.content2,contentHold.content3,contentHold.content4,contentHold.content5];
  35. for(var i=0;i<5;i++){
  36.     this["b"+i].ivar = i;
  37.     this["b"+i].onPress = function(){
  38.         menuSlide(contentArr[this.ivar]);
  39.     }
  40. }


Hope someone will give me the idea

thanks

http://fifin04.propertyaccess.com.my/te ... _final.fla
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

yes, that would be the part where you jump to a frame where you'll load the data using loadvars object.
And i'm pretty sure there is a tutorial for using loadvars too.

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 13 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.