Professional Web Applications Themes

Custom Classes with loadmovie, help! - Macromedia Flash Actionscript

Hi everyone, this is my first post here on board so please be kind. I have been studying real hard over the past few months so that I can try to get into the web industry, but as I have very limited time to study I could really do with some extra help. I have only just got internet access too, I must be about the only wanna be web designer without the web! I have recently started creating my own custom classes and have come accross a problem I can't figure out. What I want to do is create ...

  1. #1

    Default Custom Classes with loadmovie, help!

    Hi everyone, this is my first post here on board so please be kind. I have been studying real hard over the past few months so that I can try to get into the web industry, but as I have very limited time to study I could really do with some extra help. I have only just got internet access too, I must be about the only wanna be web designer without the web!

    I have recently started creating my own custom classes and have come accross a problem I can't figure out. What I want to do is create a Photo Class that has a built in function to allow photo's to scale to fill a photo frame when they are dragged over the photo frame. This I have managed fine but then realised it would be better to have all my photo's as external files, otherwise I would have to have all my photo's load on the first frame of the movie!

    My problem is this. Once I have created the custom class how to I assosiate this with an external swf or Jpeg? I am aware of Send functions but don't know If and how I should use this. Please can you view my code below and comment (Please be kind as I am trying my best and I know it could be better). Its from the last 5 lines or so that I start to struggle. I can create an empty movie clip to load the SWF but then what? Do I need to register the loaded movie? Any help would be much appreciated.


    Photo.prototype = new MovieClip();
    function photo() {
    }
    photo.prototype.picFrame = function() {
    this.onPress = function() {
    this.startDrag(true);
    };
    this.onRelease = function() {
    this.stopDrag();
    if (this.hitTest(frame) == true) {
    this.onEnterFrame = function() {
    targetsX = (200-this._xscale)/2;
    targetsY = (200-this._yscale)/2;
    this._xscale += targetsX;
    this._yscale += targetsY;
    this._x = _root.frame._x;
    this._y = _root.frame._y;
    };
    } else {
    this._x = 100;
    this._y = 100;
    }
    };
    };
    Object.registerClass("holder", photo);
    _root.attachMovie("holder", "photo", 2, {_x:100, _y:100});


    _root.createEmptyMovieClip("holder", 2);
    _root.holder.loadMovie("testphoto.swf");
    _root.holder.picframe();



    Thanks once again and all the best,


    Jason


    The dedicated lad webforumsuser@macromedia.com Guest

  2. #2

    Default Re:Custom Classes with loadmovie, help!

    Sorry to reply to my own topic but I could really do with some help on this one if possible.

    Thanks,

    Jason


    The dedicated lad webforumsuser@macromedia.com Guest

  3. #3

    Default Re:Custom Classes with loadmovie, help!

    Sorry, but I would really like to know the answer to this one. How would you go about associating a custom class definition in the main movie with an object in an external, loaded SWF or jpeg? I have not seen this question anywhere else and would really like to know.

    Thanks once again and sorry to clog up the board!

    Jason


    The dedicated lad webforumsuser@macromedia.com Guest

Similar Threads

  1. casting custom classes
    By Sam in forum ASP.NET Building Controls
    Replies: 2
    Last Post: July 27th, 09:50 AM
  2. custom types: classes
    By Chris in forum ASP.NET Web Services
    Replies: 5
    Last Post: June 24th, 05:55 PM
  3. Custom classes with web services
    By Chris Dunaway in forum ASP.NET Web Services
    Replies: 3
    Last Post: December 2nd, 12:52 AM
  4. Events in Custom Controls and Sub Classes
    By Reiner Max in forum ASP.NET Building Controls
    Replies: 1
    Last Post: June 15th, 12:14 PM
  5. Creating custom classes
    By Pea in forum Macromedia Flash Actionscript
    Replies: 0
    Last Post: March 4th, 07:14 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139