Viewty
Would you like to react to this message? Create an account in a few clicks or log in to continue.

2. Nahrávání souborů

Goto down

2. Nahrávání souborů Empty 2. Nahrávání souborů

Příspěvek  Admin Sun Mar 01, 2009 6:40 pm

Pro název symbolu,tlačítek a movie klipu používejte anglické názvy pro lepší orientaci
Vytvořte nový symbol v knihovně( Library), Jako nazev MovieClipu,dejte 'Uživatelsky obrazek' pouzil bych ‘User Image’ . Vratte se k úpravě hlavní časové osy volbou 'Scene 1' těsně pod časovým harmonogramem (timeline). Nyní vyberte 'UserImage' MovieClip z knihovny a přetáhněte jej na plochu, pak zvolte pozici x: 250px, y: 0px takže bude mimo plochu, nakonec pojmenujte například 'userImage_mc' v Inspektor vlastností (properties inspector). Nyní vytvořte další nový MovieClip v knihovně, a nazvate ho 'pozadí' (‘Background’). Vytvořite novou vrstvu uvnitř 'pozadí' (Background) symbol a pojmenujte to 'Script', název vrstvy bude 'Barva pozadí' ('Background Color’). Vyberte první snímek z 'Script' vrstvu (layer), otevřete editor Akce ( Actions ) a zadejte:

kód:
stop();

2. Nahrávání souborů Ku99010
Nyní zvolte první snímek (frame) z ‘Background Color’ layer a vytvořte obdélník (Rectangle) z šířka: 240px, výška: 400px, a to na pozici x: 0px, y: 0px. Nedavej zadny obris v nastaveni obdélníku (obrys žádný) a vyplňte o '# 000000' (černá).
Vytvořte dvě nové keyframes v ‘Background Color’ layer, a dva nové prázdné keyframes v 'Script' (layer), jak je ukázáno na obrázku.
Vyberte druhý snímek z ‘Background Color’ layer a změnte vyplnit obdélníku na '# 212121' (Dark Gray), pak zvolte třetí snímek z ‘Background Color’ layer a změnte vyplnit obdélníku na ' # 000033 '(Dark Blue). Můžete samozřejmě použít jakekoli barvy místo nich,cokoliv se vám líbí . Nyní se vraťte na hlavní scéně, vyberte první snímek (frame) z ‘Background’ layer a pomoci drag and drop Oznacit a vlozit ‘Background’ MovieClip z knihovny na scénu, a to na pozici x: 0px, y: 0px a dát mu například jméno 'background_mc '. Vyberte první snímek (frame) z 'Error' vrstvu (layer), a vytvořte dynamický text-box s šířka: 210px, výška: 230px, a to na pozici x: 15px, y: 80px. Pojmenujte text-box například jménem 'error_tf', nastavit font-color na '# FFFFFF' (bílá), nastavit font-size se 20pts a text centrum-sladěny (text center-aligned). Nyní zvolte první snímek z 'Script' vrstvu (layer), otevřete editor Akce a zadejte následující ActionScript kód:

kód:
stop();//Stop the playhead from continuing
//Declare variables var errorMessage:String = "";//For any errors loading XML or user icon var thisDirectory:String = this._url.slice(0, this._url.lastIndexOf("/"))+"/"; /*Gets this file's current location, takes off anything at and after the last occurence of the forward slash "/" character, then re-adds the "/" to the end to give the directory of this file.*/ var iconLinkArr:Array = new Array();//Array to hold dep and id values for our icons var backgroundNum:Number = 1;//User-selected background number var currentIconNum:Number = 0;//Currently selected icon in the reel var maxIconNum:Number = 12;//Max. number of icons in the reel //Hide the show/hide shortcut arrows _root.idleChanger_mc.unloadMovie(); //Hide the normal phone menu _root.mc_idle.idelLauncher.gotoAndStop(11); //Hide the operator text _root.cur_main = "shortCut"; platform.setIdleCondition(); //Hide the shortCut launcher _root.mc_idle.shortCut_mc._y = 401; //Function to load the configuration data from the XML file function loadXML() { var configXML = new XML();//Create a new XML document configXML.ignoreWhite = true;//Ignore white-space configXML.onLoad = function(success:Boolean) { if (success) { //Import XML to variables var rootNode:Array = configXML.firstChild.childNodes; var backgroundNode:XMLNode = rootNode[0]; var iconNode:Array = rootNode[1].childNodes;//Array type rather than XML node //as it holds many XML nodes backgroundNum = Number(backgroundNode.attributes.num);//Get the background number //Loop through iconNode and put all icon properties into iconLinkArr for (var i:Number = 0; i<maxIconNum; i++) { iconLinkArr[i] = new Object(); iconLinkArr[i].__label = iconNode[i].attributes.str; iconLinkArr[i].__id = iconNode[i].attributes.id; iconLinkArr[i].__dep = iconNode[i].attributes.dep; } //Now load user image loadUserImage(); } else { //Could not find XML file or it is not a valid XML file //Show an error message to the user so they know whats up. errorMessage += "Sorry we could not find your config.xml file," + " it should be in the following place: " + “ thisDirectory + "MyTheme/" + "\n" //New line character + "Please put it in the right place."; //Now load user image loadUserImage(); } }; configXML.load(thisDirectory+"MyTheme/"+"config.xml"); } function loadUserImage() { //Create our MovieClipLoader, we use this instead of the straight MovieClip.loadMovie() //method so we know whether the icon was loaded successfully var imageLoader:MovieClipLoader = new MovieClipLoader(); //Create our listener for MovieClipLoader
var imageListener:Object = new Object(); //Occurs when file has loaded and is ready to be used imageListener.onLoadInit = function() { checkErrors(); }; //Occurs when file cannot be found or is an invalid type imageListener.onLoadError = function() { //Add a couple of new line characters to error message if it already has some //text in it (from errors loading the XML) if (errorMessage != "") { errorMessage += "\n\n"; } errorMessage += "Sorry we could not find your user_image.jpg file," + " it should be in the following place: " + thisDirectory + "MyTheme/" + "\n" //New line character + "Please put it in the right place."; checkErrors(); }; imageLoader.addListener(imageListener); imageLoader.loadClip(thisDirectory+"MyTheme/"+"user_image.jpg",userImage_mc); } function checkErrors() { if (errorMessage == "") { //No errors, we're fine to continue gotoAndStop("INIT"); } else { //Oops something's up, output the error to the text box error_tf.text = errorMessage; } } //Function is called when user exits the phone NYX menu function effectIn() { //We need to hide the normal launcher again //Hide the show/hide shortcut arrows _root.idleChanger_mc.unloadMovie(); //Hide the normal phone menu _root.mc_idle.idelLauncher.gotoAndStop(11); //Hide the operator text _root.cur_main = "shortCut"; platform.setIdleCondition(); //Hide the shortCut launcher _root.mc_idle.shortCut_mc._y = 401; gotoAndStop("MAIN"); } //Function is called when user opens the phone NYX menu function effectOut() { gotoAndStop("MENU"); } //Event call function function eventCall(dep:String, id:String) { if (!platform) { return undefined; //Don't do anything when you test it on the Computer //because the apps aren't there } if (id == undefined || id == "") { //No id means it's not an application, //so open the NYX menu at the page //specified by the dep platform.setMenuOn();
_root.idleQuick = true; _root.QuickSet(dep); return; //Stop going any further in this function } //If we got this far it must be an application //Use the id to launch the correct application platform.launch_module(id); } //Start loading XML loadXML();
Admin
Admin
Moderator
Moderator

Poeet p?íspivku : 282
Reputation : 25
Points : 6234
Registration date : 31. 05. 08

Admin
admin: Ja

https://ku990.forumakers.com

Návrat nahoru Goto down

Návrat nahoru

- Similar topics

 
Povolení tohoto fóra:
Nemůžete odpovídat na témata v tomto fóru