Page 9 of 33 FirstFirst ... 789101119 ... LastLast
Results 81 to 90 of 327

Thread: new to flash 2004 mx

  1. #81
    Join Date
    Mar 2008
    Posts
    222
    Thanks
    10
    Thanked 3 Times in 3 Posts

    Default

    I never once thought the panel& thumb will be SO important, thanks for enlightening me. Hmm, i read flash mx bible, but I dun realli see Panel & thumb while reading the part on movie clip. Are they classes or objects.

    I'm a little confused by your first comment. The thumb and panel do a lot! The panel is the container clip. All of the logos are inside the panel movieclip. The scrolling function actually just movies the panel from left to right.

  2. #82
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Quote Originally Posted by hyk View Post
    I never once thought the panel& thumb will be SO important, thanks for enlightening me. Hmm, i read flash mx bible, but I dun realli see Panel & thumb while reading the part on movie clip. Are they classes or objects.
    Oh, I see why you were confused. They're not native Flash objects! They're movieclips I created using the createEmptyMovieClip() method. panel and thumb are instance names.

    Panel is the container that holds all of the logos. To get the scroll, I use MC Tween to move the panel left and right.

    Inside panel are a bunch of movieclips called symbol1, symbol2, symbol3, etc...
    Inside the symbols there is the thumb movieclip. The image loads inside the thumb.

    You can't load images into the symbol movieclip because once you load something into it, you basically overwrite it. So, mouse events won't register with it and we need it to link to a website.

  3. #83
    Join Date
    Mar 2008
    Posts
    222
    Thanks
    10
    Thanked 3 Times in 3 Posts

    Default

    oic, the marquee i had orginally had a createEmptyMovieClip() method . This part i understand. The mc_tween was what you told me to download. Yea get a much clearer understanding of the codes. and thanks for clearing the thumb& panel.

    Eh medy, something is wrong somewhere. First, i deleted all the layers expect the "actions" layer. Secondly, I deleted the extra* code which u told mi to. When i run, nothing comes out( just to be safe, i also copy 1 url address to the logos.txt)

    Code:
    mascots.onRollOver = lightUp;
    function lightUp() {
    	mascots.beibei.colorTo(0x4f96c4, .5, "easeOutQuad");
    	mascots.jingjing.colorTo(0x70c63d, .5, "easeOutQuad");
    	mascots.huanhuan.colorTo(0xff000e, .5, "easeOutQuad");
    	mascots.yingying.colorTo(0xfd7100, .5, "easeOutQuad");
    	mascots.nini.colorTo(0x008536, .5, "easeOutQuad");
    	mascots.blurTo(15,2,.5, "easeInOutQuad", .25);
    	mascots.alphaTo(0, .5, "linear", .25, function() {
    														loadContainers();
    														this.swapDepths(this._parent.getNextHighestDepth());   					                                     this.removeMovieClip();
    The hightlight text was the one i deleted, since its was used for the mascots.

    Code:
    // Set _alpha properties to 0 	panel["symbol"+i]._alpha = 0;
    		panel["symbol"+i]["thumb"]["image"]._alpha = 0;
    why do i need to delete this line medyman? i thought this line is the postioning of the slider of the images???

    I also goggle on stuff such as getBounds,roundedXSlideTo in case they might turn out to be as3 codes, but they can be used for as2. hmmm, strange very strange. Had the MC_tween2 installed too( is that an as3 code)?


    My last qns for the day medy , just to check it out, i copy my files, text files etc into the the .fla & delete your logo text etc (in short exchanging*)
    But when i run the program there is an error ( the only different i feel was my pics were in .jpg & yours were in gif)
    Last edited by hyk; 04-23-2008 at 09:23 AM.

  4. #84
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    oic, the marquee i had orginally had a createEmptyMovieClip() method . This part i understand. The mc_tween was what you told me to download. Yea get a much clearer understanding of the codes. and thanks for clearing the thumb& panel.
    Yup, the createEmptyMovieClip() method is how you would create movieclips dynamically. There is also the duplicateMovieClip() method if you want to (obviously) duplicate it.

    Eh medy, something is wrong somewhere. First, i deleted all the layers expect the "actions" layer. Secondly, I deleted the extra* code which u told mi to. When i run, nothing comes out( just to be safe, i also copy 1 url address to the logos.txt)
    Did you add the loadContainer(); function call to the lv2.onData function?

    why do i need to delete this line medyman? i thought this line is the postioning of the slider of the images???
    You don't have to delete those lines. The alpha property controls the transpareny of a clip (from a 0 to 100). What I'm doing there is setting everything to be 100% transparent/clear. So, when it first loads, you can't see it. Then I tween(animate) the alpha property to 100 in the for loop by a seperation of 0.1 seconds. It's only for visual effects. It serves no functional purpose.

    I also goggle on stuff such as getBounds,roundedXSlideTo in case they might turn out to be as3 codes, but they can be used for as2. hmmm, strange very strange. Had the MC_tween2 installed too( is that an as3 code)?
    No, MC Tween is an AS2 extention. Zeh Fernando, the creator of MC Tween, also created the Tweener class, which is the AS3 equivalant. Tweener can also be used for AS2.

    getBounds() is also an AS2 method. It's been around since at least Flash MX 2004 and Flash Player 5. Here are the MX 2004 docs for getBounds(). Basically, what getBounds() does is provide the coordinates for the boundaries of the movieclip.

    I used getBounds() to simulate the onRollOver effect. Flash has a bug where you can't have nested mouse events. So you can't interact within a movieclip that has any mouse events. Since our panel movieclip has mouse events, you wouldn't be able to click on the logos if we didn't do it this way.

    If you want a more visual explanation, you can check out the "Scrolling Thumbnail Panel" tutorial by Lee Brimelow at gotoandlearn.com. Be careful though! Some of the coding techniques are the same, but I am not using his code, so what he is using getBounds for is different than what I am. And how he animates his panel is different from how I do it. Don't get confused.

    Lastly, roundedXSlideTo is a method of MC Tween. Here is the documentation for it. Again, very much AS2! MC Tween doesn't work in AS3.

    i copy my files, text files etc into the the .fla & delete your logo text etc (in short exchanging*)
    But when i run the program there is an error ( the only different i feel was my pics were in .jpg & yours were in gif)
    Are you getting an actual error? Or is it just blank?

    Make sure you add the loadContainers() function call to the lv2.onData event. If it still doesn't work. Paste your AS here, all of it.
    Last edited by Medyman; 04-23-2008 at 01:57 PM. Reason: code -> quotes

  5. #85
    Join Date
    Mar 2008
    Posts
    222
    Thanks
    10
    Thanked 3 Times in 3 Posts

    Default

    okie medy, if i not mistaken its a error of my file, the opening of my image file
    Mind i paste the error when i get back to school tomorrow? ya, i followed what u told me to do, will check over it again. ok, i update u again

    The links etc, i taken a look already, (found it in google). I find it quite interesting, but when i try to write it. omg, nothing comes out.

    oh, btw u told me to delete the _alpha right, when i delete the whole thing became blank. anyway, i go check out on it if there is still an error i paste it here

  6. #86
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Mind i paste the error when i get back to school tomorrow
    No! I want it now. lol

    but when i try to write it. omg, nothing comes out.
    Post the errors you get verbatim tomorrow and I'll see what's the problem. If you followed my instructions, then there shouldn't be any AS problems. So it might be either related to the file paths and/or the text files.
    Last edited by Medyman; 04-23-2008 at 02:01 PM. Reason: code -> quote

  7. #87
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    If you notice, the images show up in order, seperated by .1 seconds. If you want to get rid of that. Delete
    Code:
    // Set _alpha properties to 0 so we can control when things are shown; looks more organized
    		panel["symbol"+i]._alpha = 0;
    		panel["symbol"+i]["thumb"]["image"]._alpha = 0;
    You don't have to delete them. But if you wanted to get rid of the effect, you do.

  8. #88
    Join Date
    Mar 2008
    Posts
    222
    Thanks
    10
    Thanked 3 Times in 3 Posts

    Default

    YES MEDY-SIR. that line i played with it just now, it controls the size & postion of the pics.

    I do the checking & error pasting 1st thing tomorrow

    Anymore you want me to take a look in? MEDY

  9. #89
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Quote Originally Posted by hyk View Post
    YES MEDY-SIR. that line i played with it just now, it controls the size & postion of the pics.
    What line are you talking about?

    Code:
    // Set _alpha properties to 0 so we can control when things are shown; looks more organized
    		panel["symbol"+i]._alpha = 0;
    		panel["symbol"+i]["thumb"]["image"]._alpha = 0;
    This 100% does not control either the size or the position. The size isn't set anywhere in the coding. And the position is the line with _x in it.

    Some reading.

  10. #90
    Join Date
    Mar 2008
    Posts
    222
    Thanks
    10
    Thanked 3 Times in 3 Posts

    Default

    Code:
    // Set _alpha properties to 0 so we can control when things are shown; looks more organized
    		panel["symbol"+i]._alpha = 0;
    		panel["symbol"+i]["thumb"]["image"]._alpha = 0;
    Sorrie, i saw the wrong line medy . its the panel["symbol"+i]._x that controls the sizes. right?

    Did you add the loadContainer(); function call to the lv2.onData function?
    hmm at the beginning when i edit this line, it "works", the marquee is going over the mascots. As i was deleting other lines, well i only see the the mascots. Okie, the script is posted below.

    Code:
    #include "mc_tween2.as"
    
    var images:Array = [];  
    var urls:Array = [];  
    
    var lv:LoadVars = new LoadVars();
    var lv2:LoadVars = new LoadVars();
    
    lv.onData = function(src:String) {
    	images = src.split("\r\n");  }
    
    lv2.onData = function(src:String) {
    	urls = src.split("\r\n");
    	loadContainers( );
    }
    
    
    lv.load("logos.txt");
    lv2.load("urls.txt");
    
    mascots.onRollOver = lightUp;
    function lightUp() {
    	mascots.beibei.colorTo(0x4f96c4, .5, "easeOutQuad");
    	mascots.jingjing.colorTo(0x70c63d, .5, "easeOutQuad");
    	mascots.huanhuan.colorTo(0xff000e, .5, "easeOutQuad");
    	mascots.yingying.colorTo(0xfd7100, .5, "easeOutQuad");
    	mascots.nini.colorTo(0x008536, .5, "easeOutQuad");
    	mascots.blurTo(15,2,.5, "easeInOutQuad", .25);
    	mascots.alphaTo(0, .5, "linear", .25, function() {
    								loadContainers();
    									this.swapDepths(this._parent.getNextHighestDepth());   						
                this.removeMovieClip();
    													 });
    }
    
    this.createEmptyMovieClip("panel", this.getNextHighestDepth());
    
    
    var count:Number = 0;  
    function loadContainers() {
    	for(i=0;i<images.length-1;i++) {
    	var symbol:MovieClip = panel.createEmptyMovieClip("symbol"+i, i);
    		var thumb:MovieClip = panel["symbol"+i].createEmptyMovieClip("thumb", i);	
    		
    		var image:MovieClip = panel["symbol"+i]["thumb"].createEmptyMovieClip("image", 30+i);
    
    		// You can go here. Position each symbol
    		panel["symbol"+i]._x = 202*i
    		panel["symbol"+i]._y = Stage.height/4;
    		
    		
    		
    		
    
    		panel["symbol"+i].alphaTo(100, .25, "easeOutQuad", (.1*i));
    		
    		// MovieClipLoader
    		var mcl:MovieClipLoader = new MovieClipLoader();
    		var mclL:Object = new Object();
    		
    		mclL.onLoadComplete = function() {
    			
    			count++;
    			if(count ==images.length-1) {
    			
    				showThumbs();
    			}
    		}		
    		
    		
    		mcl.loadClip("events/"+images[i], panel["symbol" +i]["thumb"]["image"]);
    		mcl.addListener(mclL);
    		
    		
    		panel["symbol"+i].id = i;  
    		panel["symbol"+i].onRelease = function() {
    		getURL(urls[this.id]);
    		}
    	}
    }
    
    
    function showThumbs() {
    	for(i=0;i<images.length-1;i++) {
    		var symbol = panel["symbol"+i].thumb.image
    		var delay = (0.1*i)+.25
    		symbol.alphaTo(100, .5, "easeOutQuad", delay);
    	}
    	beginScroll();
    }
    
    
    
    function beginScroll() {
    	var limit = Stage.width - panel._width  	
                 var time = panel._width / 150;  
    	
    
    	if(panel._x <= limit) {
    		panel.roundedXSlideTo(0, time, "linear", .25, beginScroll);
    	}
    	
    	else {
    	panel.roundedXSlideTo(limit, time, "linear", .25,beginScroll);
    	}
    	
    	panel.onRollOver = pauseResume; 
    }
    
    
    function pauseResume() {
    	delete this.onRollOver;
    	this.pauseTween("_x");
    	var x = panel.getBounds(_root);
    	
    	
    	this.onEnterFrame = function() {
    
    if(_xmouse<x.xMin || _xmouse>x.xMax || _ymouse<x.yMin || _ymouse>x.yMax) {
    			this.resumeTween("_x");
    			this.onRollOver = pauseResume;
    			delete this.onEnterFrame;
    		}
    	}
    }

    i delete all the comments& hopefully never delete any codes, if you have a hard time reading it let me know, i edit my post again asap. Maybe i need to delete the .mascots codes too, to make the whole marquee works.

    note: I only change the codes ( file names etc, i leave me as the same) & eh if you find any errors which i forgetten to edit, change etc feel free to say in BOLD

    var mclL, what that? i thought that was only something called mcl but i never heard of mclL yet
    Last edited by hyk; 04-24-2008 at 01:27 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
  •