Page 13 of 33 FirstFirst ... 3111213141523 ... LastLast
Results 121 to 130 of 327

Thread: new to flash 2004 mx

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

    Default

    ahh i get it just tried inserting a link with a image, well its works. thanks

    Right so i put all the url into the images folder immediately. How should i move on frm parsing to display?

    lol, never thought the traces can be useful as a troubleshoot/debugging techinquie. interesting
    Last edited by hyk; 04-28-2008 at 02:43 AM.

  2. #122
    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
    lol, never thought the traces can be useful as a troubleshoot/debugging techinquie. interesting
    That's basically their main purpose, lol. Traces only output to the "Output" panel in the Flash IDE, so there is not much more use for them.

    As far as integrating...
    take a look at the initial marquee AS, remove all references to lv2 (the 2nd text file's loadvars).

    Then you want to use the variables in the for loop. Look at the testMe() function for an idea of what the variable names might be.

    Remember the trace technique. If you're not sure that it's working. Throw the value into a trace function and see what's really happening.

    Post the code you're working with if you run into any problems.

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

    Default

    erm ya, doing that now. just finish transfering the urls. thought you went offline, your bulb* went off

    Oh i did not put the traces but in the testMe(), I put it loadContainers since there is a loadContainers below the function

    oh ya, just a qns to ask too, the "symbol"& panel do i need to change their names? some of the vars I`m sure i need to changes their names for example "image" to "images" Oh, i just post half of it, if you want the whole chunk i edit the post( restore your commments back to their former glory ) Befor you starting cursing me(which i hope you won`t ) I personally suspect its the problem with symbols* & thumbs* & panel* )since they were in the orginal script

    Code:
    var rawdata:Array = [];  //  stores all the raw data
    var images:Array = [];  //  stores symbol image file names
    var urls:Array = [];  //  stores associated website URLs
    
    var lv:LoadVars = new LoadVars();
    
    lv.onData = function(src:String) {
    	rawdata = src.split("\r\n");  // Seperates the raw data based on line breaks.  Output image.jpg|http://www.website.co,
    
    	for(i=0;i<rawdata.length-1;i++) {   // Loops through all of the raw data
    		info = rawdata[i].split("|");  // Seperates each array element by a delimiter (vertical bar).  Resulting array:  info[rawdata[i]] = (info[0], info[1]) or (image, uri)
    		images.push(info[0]);  // "Pushes" the 0th value (the image path) to the images array for later access
    		urls.push(info[1]);  //  "Pushes" the 1st value to the urls array for later access
    	}
     loadContainers();
    }
    
    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);
    		panel["symbol"+i]._x = 150*i                          //gap between the images
    		panel["symbol"+i]._y = Stage.height/4;        // height of the marquee
    		
    		var mcl:MovieClipLoader = new MovieClipLoader();
    		var mclL:Object = new Object();
    		
    		mclL.onLoadComplete = function() {
    		count++;
    			if(count ==images.length-1) {
    				beginScroll();
    			}
    		}		
    		
    		mcl.loadClip("rawdata/"+images[i], panel["symbol" +i]["thumb"]["images"]);
    		mcl.addListener(mclL);
    		
    		panel["symbol"+i].id = i;
    		panel["symbol"+i].onRelease = function() {
    		getURL(urls[this.id]);
    		}
    	}
    }
    Last edited by hyk; 04-28-2008 at 09:59 AM.

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

    Default

    I'll take a closer look at the changes you made in a few hours when I'm a bit freer.

    But...
    You don't need to change any variable names. The "image" variable refers to something totally different than the "images" variable. Maybe it's confusing because the names I used are so similar, but that's my own coding convention -- it make sense to me.

    "images" refers to an array that contains all of the filenames
    "image" refers to a single element within that array

    You shouldn't have to change anything in the for loop. Just the loadVars part needs to be changed.

    Quickly, I see you changed this line:
    Code:
    mcl.loadClip("rawdata/"+images[i], panel["symbol" +i]["thumb"]["images"]);
    That's probably what's causing the error. The highlighted part is the relative path to the image from the flash movie. images[i] is being sent from the text file (this part should word fine). The "rawdata/" is the folder that the images lie in. It's not a variable. So if you changed your folder name to rawdata, that's different. Otherwise, it needs to be images/ or logos/ or w/e it's called.

    Anything within double quotes is a literal string, not a variable.

    Again the only changes you need to make are to the lv.onData event, which looks like you did right.
    By the way, this is the perfect place to insert some traces and see what was working and what's not. You would probably find that the movie clip is created but the images aren't loading, which means your path is off.

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

    Default

    i assumed i do not need to put traces since the above part is okie,
    I learnt a lesson which programming does not teach ( Do not assume, )

    the rawdata was wrong? at the beginning, its was events( from the file you uploaded) So i assume* its should be changed

    k thanks, you go do your stuffs 1st, I looking through it too
    I thought some stuff of the name you uploaded was different from the tutorial you wrote? hmm, nvm i could check it out tomorow

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

    Default

    i assumed i do not need to put traces since the above part is okie
    It's ok the way I wrote it. But if you're changing variables, adding traces to make sure that you changed them correctly is an easy way to diagnose the problem

    the rawdata was wrong? at the beginning, its was events( from the file you uploaded) So i assume* its should be changed
    It should be changed, but to the name of the directory that the images are in. Your folder was called images before. If it's the same you want to the string to be "images/" not "rawdata/". The only way "rawdata/" would work is if you renamed the directory to rawdata.

    You don't need to change any variable names. The only thing you need to change are the lv.load() statement to match your text file's filename and the string ("rawdata/") in the loadClip statement to direct to your images directory. That's it.

    With that said, you can change the variable names if you want to. As long as you change all instances of the variable name, it doesn't matter. But chances are that you might miss one or two of those instances and the code won't work. So, it's better to leave them be unless you have a good reason to change them.

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

    Default

    my orginally image folder(became rawdata) so you mean i put everything back to normal 1st? I edited if there any probs i check with u again. I re-read your last post again tomorow. Thanks for the tip
    Last edited by hyk; 04-28-2008 at 04:13 PM.

  8. #128
    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
    my orginally image folder(became rawdata) so you mean i put everything back to normal 1st? I edited if there any probs i check with u again. I re-read your last post again tomorow. Thanks for the tip
    So the folder with your logos in it is called rawdata? If so, then the code should work. I suspect you're misunderstanding me though.

    I'm talking about the actual directory that the images are in. If the folder is called images, you would put images there not rawdata.

    Back to HTML...
    Code:
    <img src="images/logo.jpg">
    The highlighted part is what that string is...the folder path.

    Does that make it clear?

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

    Default

    OMG, I forgot the most important of them all when i look through it. the textfile which stores all the names & urls. As for the tracing part, I did it. well everything is al`right now(included the editing of the variables)

    mcl.loadClip("rawdata/"+images[i], panel["symbol" +i]["thumb"]["images"]);
    the rawdata* name is depending on what name i put (file which stores all the pics) right?

    Code:
       }
       testMe();
    }
    	function testMe() {
    	for(i=0;i<rawdata.length-1;i++) {
    		trace("Raw Data: " + rawdata[i]);  // Rawdata -- as in the text file
    		trace("Image: " + images[i]); // Image path
    		trace("URL; " + urls[i]);  //  URL path
    		trace("");  // Line Break
    	}
    }
    When i replace the testMe(hightlighted) to loadContainers() & deleting all the traces, they gave errors such as error opening URl
    what is the error about? ( I copy the folder onto desktop which gave this error)


    "file:///C|/Documents%20and%20Settings/hyk/Desktop/New%20Folder/rawdata/ACE.jpg
    So the folder with your logos in it is called rawdata? If so, then the code should work. I suspect you're misunderstanding me though.
    Ok, so the name of the file ( storing all the pics ) is called rawdata. I`m right about this

    I abit confused about this part , folder with your logos &actual directory that the images are in.

    there should only be 2 files which is not flash in the folder where i storing all the things included fla & swf ( the textfile to store the names of the URLS & xxx.jpg, a folder where all the images is a.ka rawdata)

    Eh, why is there html?
    Last edited by hyk; 04-29-2008 at 01:30 AM.

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

    Default

    Ok...let's clear up this confusion.

    Now, what I'm about to ask you to do has nothing to do with the marquee. So, don't get confused by it.

    Let's say you were creating a regular HTML page, for example's sake. Now, how would you add the ACE.jpg logo? What would your code be?

    Code:
    <img src="..." >
    What would you add in place of the highlighted part above?

    Note: The HTML file would be in the same exact place as your .swf is now.

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
  •