*URGENT* REFERENCE POINT confusion

  • DurianFruit
  • Novice
  • Novice
  • DurianFruit
  • Posts: 33
  • Loc: Toronto, ON

Post 3+ Months Ago

I have a variable in 1.swf that is suppose to load 2.swf. HOWEVER I have 2 different reference points in 2.swf due to 2 squares one is the background image and the other is a picture square located in the center of 2.swf.

Right now when 1.swf loads 2.swf it loads it based on the photo square and misaligns everything.

Also I have buttons in 2.swf that don't show up for some reason when its loaded into 1.swf.

Problems:
1. When it loads it loads based on the wrong reference point of the picture square

2. I have buttons in 2.awf that don't show up when loaded into 1.swf


PLEASE help me up guys This this is URGENT!
THANKS!
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Tchuki
  • Mastermind
  • Mastermind
  • Tchuki
  • Posts: 1774
  • Loc: Edinburgh

Post 3+ Months Ago

Are the reference points empty movieClips or what ?

How are you loading them in etc ?
  • DurianFruit
  • Novice
  • Novice
  • DurianFruit
  • Posts: 33
  • Loc: Toronto, ON

Post 3+ Months Ago

These 2 reference points are located in the 2.swf.
The 1st reference point is for a square block which I made it a movie clip.
The 2nd reference point is for a picture square that loads pictures based on a forward and backward arrow. I want it to load based on the black block and not based on the picture square.

How I load the 2.swf into 1.swf is by using a symbol with and instance name 'contents' created in 1.swf then I say at the press of a button load 2.swf into contents that is in 1.swf.
  • Tchuki
  • Mastermind
  • Mastermind
  • Tchuki
  • Posts: 1774
  • Loc: Edinburgh

Post 3+ Months Ago

Are you using instance names ?
  • DurianFruit
  • Novice
  • Novice
  • DurianFruit
  • Posts: 33
  • Loc: Toronto, ON

Post 3+ Months Ago

Yup. I am for the variable thats loading 2.swf into 1.swf

Do I need to explain more ? I may sound a bit confusing.
  • roarmeow
  • Professor
  • Professor
  • User avatar
  • Posts: 861
  • Loc: BKNY

Post 3+ Months Ago

make sure the block movieclip has a unique instance name...
then, the code
Code: [ Select ]
on(release){
loadMovie("2.swf","contents");}
  1. on(release){
  2. loadMovie("2.swf","contents");}

should do the trick...
is this what you're doing?

are you sure that the picture square does not also have the instance name 'contents'? if so, that could be causing the confusion...

the best thing, i think, would be to load 2.swf using loadMovieNum and then place it in the proper position using setProperty or something, but that's a little more involved...
  • DurianFruit
  • Novice
  • Novice
  • DurianFruit
  • Posts: 33
  • Loc: Toronto, ON

Post 3+ Months Ago

Nope not working.

The picture square has the instance name 'photo'
and right now it seems to be loading based on the up left corner of the photo square. =(
  • DurianFruit
  • Novice
  • Novice
  • DurianFruit
  • Posts: 33
  • Loc: Toronto, ON

Post 3+ Months Ago

right now the action script in the button that launches 2.swf into 1.swf
is this

Code: [ Select ]
on (press) {
    _root.contents.loadMovie("2.swf");
}
  1. on (press) {
  2.     _root.contents.loadMovie("2.swf");
  3. }


Is there a way where I can put cordinates in the ' ("2.swf"); ' line as to where to load as reference point?

Another problem is that I have buttons inside the 2.swf that aren't even seen once its loaded into 1.swf. Why is that? Its weird.
  • DurianFruit
  • Novice
  • Novice
  • DurianFruit
  • Posts: 33
  • Loc: Toronto, ON

Post 3+ Months Ago

Hmm.... I think I found the problem for both the 1. reference point and 2. the button dissapearance problems.

This is the code used for the picture slide show square after I tried deleting the actions layer:
1. the 2.swf loaded on the correct reference point and...
2. the buttons which dissappeared came back and is usable.

Here's the code I used ( this code is on an Actions layer in 2.swf):

Code: [ Select ]
//Code written by sbeener (suprabeener)
/*
  i wrote this code, but you can use and abuse it however you like.
  the methods are defined in the order which they occur to make it
  easier to understand.
*/
// variables ------------------------------------------
// put the path to your pics here, include the slashes (ie. "pics/")
// leave it blank if they're in the same directory
this.pathToPics = "";
// fill this array with your pics
this.pArray = ["1.jpg", "2.jpg", "3.jpg", "4.jpg", "5.jpg", "6.jpg", "7.jpg", "8.jpg", "9.jpg", "10.jpg", "11.jpg", "12.jpg", "13.jpg", "14.jpg", "15.jpg", "16.jpg", "17.jpg", "18.jpg", "19.jpg", "20.jpg"];
this.fadeSpeed = 20;
this.pIndex = 0;
// MovieClip methods ----------------------------------
// d=direction; should 1 or -1 but can be any number
//loads an image automatically when you run animation
loadMovie(this.pathToPics+this.pArray[0], _root.photo);
MovieClip.prototype.changePhoto = function(d) {
    // make sure pIndex falls within pArray.length
    this.pIndex = (this.pIndex+d)%this.pArray.length;
    if (this.pIndex<0) {
        this.pIndex += this.pArray.length;
    }
    this.onEnterFrame = fadeOut;
};
MovieClip.prototype.fadeOut = function() {
    if (this.photo._alpha>this.fadeSpeed) {
        this.photo._alpha -= this.fadeSpeed;
    } else {
        this.loadPhoto();
    }
};
MovieClip.prototype.loadPhoto = function() {
    // specify the movieclip to load images into
    var p = _root.photo;
    //------------------------------------------
    p._alpha = 0;
    p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
    this.onEnterFrame = loadMeter;
};
MovieClip.prototype.loadMeter = function() {
    var i, l, t;
    l = this.photo.getBytesLoaded();
    t = this.photo.getBytesTotal();
    if (t>0 && t == l) {
        this.onEnterFrame = fadeIn;
    } else {
        trace(l/t);
    }
};
MovieClip.prototype.fadeIn = function() {
    if (this.photo._alpha<100-this.fadeSpeed) {
        this.photo._alpha += this.fadeSpeed;
    } else {
        this.photo._alpha = 100;
        this.onEnterFrame = null;
    }
};
// Actions -----------------------------------------
// these aren't necessary, just an example implementation
this.onKeyDown = function() {
    if (Key.getCode() == Key.LEFT) {
        this.changePhoto(-1);
    } else if (Key.getCode() == Key.RIGHT) {
        this.changePhoto(1);
    }
};
Key.addListener(this);
  1. //Code written by sbeener (suprabeener)
  2. /*
  3.   i wrote this code, but you can use and abuse it however you like.
  4.   the methods are defined in the order which they occur to make it
  5.   easier to understand.
  6. */
  7. // variables ------------------------------------------
  8. // put the path to your pics here, include the slashes (ie. "pics/")
  9. // leave it blank if they're in the same directory
  10. this.pathToPics = "";
  11. // fill this array with your pics
  12. this.pArray = ["1.jpg", "2.jpg", "3.jpg", "4.jpg", "5.jpg", "6.jpg", "7.jpg", "8.jpg", "9.jpg", "10.jpg", "11.jpg", "12.jpg", "13.jpg", "14.jpg", "15.jpg", "16.jpg", "17.jpg", "18.jpg", "19.jpg", "20.jpg"];
  13. this.fadeSpeed = 20;
  14. this.pIndex = 0;
  15. // MovieClip methods ----------------------------------
  16. // d=direction; should 1 or -1 but can be any number
  17. //loads an image automatically when you run animation
  18. loadMovie(this.pathToPics+this.pArray[0], _root.photo);
  19. MovieClip.prototype.changePhoto = function(d) {
  20.     // make sure pIndex falls within pArray.length
  21.     this.pIndex = (this.pIndex+d)%this.pArray.length;
  22.     if (this.pIndex<0) {
  23.         this.pIndex += this.pArray.length;
  24.     }
  25.     this.onEnterFrame = fadeOut;
  26. };
  27. MovieClip.prototype.fadeOut = function() {
  28.     if (this.photo._alpha>this.fadeSpeed) {
  29.         this.photo._alpha -= this.fadeSpeed;
  30.     } else {
  31.         this.loadPhoto();
  32.     }
  33. };
  34. MovieClip.prototype.loadPhoto = function() {
  35.     // specify the movieclip to load images into
  36.     var p = _root.photo;
  37.     //------------------------------------------
  38.     p._alpha = 0;
  39.     p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
  40.     this.onEnterFrame = loadMeter;
  41. };
  42. MovieClip.prototype.loadMeter = function() {
  43.     var i, l, t;
  44.     l = this.photo.getBytesLoaded();
  45.     t = this.photo.getBytesTotal();
  46.     if (t>0 && t == l) {
  47.         this.onEnterFrame = fadeIn;
  48.     } else {
  49.         trace(l/t);
  50.     }
  51. };
  52. MovieClip.prototype.fadeIn = function() {
  53.     if (this.photo._alpha<100-this.fadeSpeed) {
  54.         this.photo._alpha += this.fadeSpeed;
  55.     } else {
  56.         this.photo._alpha = 100;
  57.         this.onEnterFrame = null;
  58.     }
  59. };
  60. // Actions -----------------------------------------
  61. // these aren't necessary, just an example implementation
  62. this.onKeyDown = function() {
  63.     if (Key.getCode() == Key.LEFT) {
  64.         this.changePhoto(-1);
  65.     } else if (Key.getCode() == Key.RIGHT) {
  66.         this.changePhoto(1);
  67.     }
  68. };
  69. Key.addListener(this);


This code is from the ' creating a slideshow ' tutorial from
http://www.kirupa.com located in the section ' FLASH MX '

Is there a way to still use this tutorial for my website with it working properly???
  • DurianFruit
  • Novice
  • Novice
  • DurianFruit
  • Posts: 33
  • Loc: Toronto, ON

Post 3+ Months Ago

Anybody have a solution?
It would help me greatly.

Post Information

  • Total Posts in this topic: 10 posts
  • Users browsing this forum: No registered users and 14 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.