FORUMS: list search recent posts

problem with adding button to template

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
tommy mountain
problem with adding button to template
on Sep 23, 2009 at 1:07:40 pm

hello,
i've got problem with adding a button to a template, so by default there are 4 buttons. i've localized in source move clip with buttons and animation, i've copied one of them and pasted, then i've changed the name from item for to item5. the data for buttons and web pages displayed by them are from the xml file, which code i attach. the problem is that even if i added 5 section [with the number 5 in systemOrder) the webpage doesn't display this content correctly, sometimes taking the value of previous button and sometimes showing just main frame, and instead of elements and texts from xml it shows "Undefined". I've search all the source using movie explorer and i havent found anywhere else connections with item4 / item5. please, help me, i'm rather a newbie if it's about flash and after 7 hours and few attempts i understood that i need help. forgive me for this amounts of code but i think it may help or even necessary. on top there is action layer, under lablel layer [the one with s0, s3 etc.] and event source, and under those all the rest.

code xml'a

]?xml version="1.0" encoding="iso-8859-1"?[
]content[
]!-- general vars --[
]section name="settings"[
]item name="textSelectable"[true]/item[
]item name="copyright"[]![CDATA[
WebShot © 2009 • ]a href="asfunction:_root.more_click_func, privacyPolicy"[ Privacy Policy]/a[ •
]][]/item[
]item name="companyName"[]![CDATA[]font color="#b83287"[IP Phone]/font[Solutions
]][]/item[
]item name="slogan"[]![CDATA[keeping telecom's simple]][]/item[
]item name="close_txt"[]![CDATA[CLOSE WINDOW [ ]font color="#b83287"[X]/font[ ]]][]/item[
]image imageUrl="_logo.png" link="asfunction:link"/[
]/section[

]!-- menu --[
]section name="menu"[
]link systemOrder="1"[]![CDATA[
VOICE
]][]/link[

]link systemOrder="2"[]![CDATA[
BROADBAND
]][]/link[

]link systemOrder="3"[]![CDATA[
MOBILE
]][]/link[

]link systemOrder="4"[
]![CDATA[
PHONE SYSTEMS
]][]/link[

]link systemOrder="5"[
]![CDATA[
CONTACT US
]][]/link[


]/section[

]!-- pages --[
]section name="pages"[

]page name="home"[
]image imageUrl="_pic1.png" /[
]image imageUrl="_pic2.png" /[
]image imageUrl="_pic3.png" /[

]texts[

]pageText[]![CDATA[
]font color="#9c1f6e"[latest]/font[ projects
]][]/pageText[

]pageText[]![CDATA[
* HIGH
]][]/pageText[

]pageText[]![CDATA[
* QUALITY
]][]/pageText[

]pageText[]![CDATA[
* SERVICES
]][]/pageText[

]pageText[]![CDATA[
]a href="asfunction:_root.more_click_func,3"[* ]u[VIEW MORE WORKS]/u[]/a[
]][]/pageText[

]pageText[]![CDATA[
]font color="#9c1f6e"[Need New]/font[ Telephone Services?
]][]/pageText[


]pageText[]![CDATA[
ssdsd
]][]/pageText[


]pageText[]![CDATA[
Already Have]font color="#9c1f6e"[ Telephone Services?]/font[
]][]/pageText[

]pageText[]![CDATA[
asdsads
]][]/pageText[

]/texts[





]/page[

]page name="about"[
]image imageUrl="_pic4.png" link="asfunction:link"/[
]image imageUrl="_pic5.png" link="asfunction:link"/[

]texts[

]pageText[]![CDATA[
]font color="#9c1f6e"[Broadband & Data]/font[
]][]/pageText[

]pageText[]![CDATA[
dddd
]][]/pageText[

]pageText[]![CDATA[
Why use ]font color="#9c1f6e"[Connect Broadband?]/font[
]][]/pageText[


]pageText[]![CDATA[
adsdsd
]][]/pageText[



]pageText[]![CDATA[
]font color="#9c1f6e"[Data]/font[
]][]/pageText[

]pageText[]![CDATA[
sdsds

]][]/pageText[


]/texts[

]/page[

]page name="portfolio"[




]texts[

]pageText[]![CDATA[
]font color="#9c1f6e"[Mobile]/font[
]][]/pageText[

]pageText[]![CDATA[

sss
]][]/pageText[

]pageText[]![CDATA[
]font color="#9c1f6e"[our]/font[ portfolio
]][]/pageText[

]pageText[]![CDATA[
]u[VIEW MORE WORKS]/u[
]][]/pageText[


]/texts[


]/page[

]page name="oldolio"[




]texts[

]pageText[]![CDATA[
]font color="#9c1f6e"[Mobile]/font[
]][]/pageText[

]pageText[]![CDATA[
dsadasdasd

]][]/pageText[

]pageText[]![CDATA[
]font color="#9c1f6e"[our]/font[ portfolio
]][]/pageText[

]pageText[]![CDATA[
]u[VIEW MORE WORKS]/u[
]][]/pageText[


]/texts[


]/page[

]page name="contacts"[
]image imageUrl="_pic6.png" link="asfunction:link"/[

]texts[

]pageText[]![CDATA[
]font color="#9c1f6e"[Contact]/font[ form
]][]/pageText[

]pageText[]![CDATA[
* ]u[CLEAR]/u[ * ]u[SEND]/u[
]][]/pageText[

]pageText[]![CDATA[
]font color="#9c1f6e"[contact]/font[ Information
]][]/pageText[


]pageText[]![CDATA[
s
]][]/pageText[

]pageText[]![CDATA[
]font color="#5f2d4d"[THE COMPANY NAME INC.]br[
a
]font color="#5f2d4d"[E-MAIL: ]a href="asfunction:link"[]u[MAIL@COMPANYNAME.COM]/u[]/a[]/font[
]][]/pageText[


]pageText[]![CDATA[
a
]][]/pageText[
]/texts[


]/page[

]/section[

]!-- privacy policy --[
]section name="privacyPolicy"[
]item name="pageTitle"[]![CDATA[
Privacy policy
]][]/item[
]item name="pageText"[]![CDATA[
sss
]][]/item[

]item name="pageTitle2"[]![CDATA[
Details
]][]/item[
]item name="pageText2"[]![CDATA[
blabla
]][]/item[


]/section[
]!-- privacy policy --[

]/content[



as - 1 frame

function onFinish(success_boolean, results_obj, xml)
{
if (success_boolean)
{
play ();
} // end if
} // End of the function
Stage.align = "MC";
Stage.scaleMode = "noScale";
url = "25903";
_root.cacheKiller = "true";
stop ();
var parsed_obj = {};
var unCash = new Date().getTime();
if (_root.cacheKiller == "true")
{
fileToLoad = url + "_main.xml?cacheKiller=" + unCash;
fileToLoad = url + "_main.xml";
}
else
{
fileToLoad = url + "_main.xml";
} // end else if
gs.dataTransfer.XMLParser.load(fileToLoad, onFinish, parsed_obj);
_root.emp.useHandCursor = 0;
_root.mus = 1;
_root.n = 1;
_root.num = 1;


second frame


function onFinish(success_boolean, gallery_obj, xml)
{
if (success_boolean)
{
play ();
} // end if
} // End of the function
function textSelectable(selectedObject)
{
isTextSelected = getSettingsValue(mainObj, "textSelectable", "item");
if (isTextSelected == "true")
{
selectedObject.selectable = true;
} // end if
} // End of the function
function getXmlSection(obj, itemName, sectionName)
{
for (i = 0; obj[itemName][i]; i++)
{
if (obj[itemName][i].name == sectionName)
{
returnedResult = true;
return (i);
break;
} // end if
} // end of for
} // End of the function
function getSettingsValue(obj, itemName, itemType)
{
sectionNum = getXmlSection(obj, "section", "settings");
for (k = 0; obj.section[sectionNum][itemType][k]; k++)
{
if (obj.section[sectionNum][itemType][k].name == itemName)
{
return (obj.section[sectionNum][itemType][k].value);
break;
} // end if
} // end of for
} // End of the function
function getCopyright(textObj)
{
textObj.htmlText = getSettingsValue(mainObj, "copyright", "item");
textSelectable(textObj);
} // End of the function
function getCompanyName(textObj)
{
textObj.htmlText = getSettingsValue(mainObj, "companyName", "item");
textSelectable(textObj);
} // End of the function
function getSlogan(textObj)
{
textObj.htmlText = getSettingsValue(mainObj, "slogan", "item");
textSelectable(textObj);
} // End of the function
function getSystemValue(textObj, systemOptionName)
{
textObj.htmlText = getSettingsValue(mainObj, systemOptionName, "item");
textSelectable(textObj);
} // End of the function
function getMenuLink(textObj, linkNum)
{
sectionNum = getXmlSection(mainObj, "section", "menu");
textObj.htmlText = mainObj.section[sectionNum].link[linkNum].value;
textSelectable(textObj);
} // End of the function
function getMenuSystemOrder(linkNum)
{
sectionNum = getXmlSection(mainObj, "section", "menu");
return (mainObj.section[sectionNum].link[linkNum].systemOrder);
} // End of the function
function getCurrentText(textObj, textNumber)
{
sectionNum = getXmlSection(mainObj, "section", "pages");
currentPage = _root.link - _root.firstPageFrame;
textObj.htmlText = mainObj.section[sectionNum].page[currentPage].texts[0].pageText[textNumber].value;
textSelectable(textObj);
} // End of the function
function getMenuPreviousLink(linkNum)
{
k = 0;
for (systemOrder = getMenuSystemOrder(k); systemOrder; systemOrder = getMenuSystemOrder(k))
{
if (systemOrder == linkNum)
{
orderResult = k + 1;
break;
} // end if
++k;
} // end of for
if (_root.link_prev == 0)
{
orderResult = 0;
} // end if
return (orderResult);
} // End of the function
function getCurrentImageName(imageNumber)
{
sectionNum = getXmlSection(mainObj, "section", "pages");
currentPage = _root.link - _root.firstPageFrame;
imageParams = new Array();
imageParams.name = mainObj.section[sectionNum].page[currentPage].image[imageNumber].imageUrl;
imageParams.linkToOpen = mainObj.section[sectionNum].page[currentPage].image[imageNumber].link;
imageParams.target = mainObj.section[sectionNum].page[currentPage].image[imageNumber].target;
return (imageParams);
} // End of the function
function getCurrentImageName_splash(imageNumber)
{
sectionNum = getXmlSection(mainObj, "section", "settings");
imageParams = new Array();
imageParams.name = mainObj.section[sectionNum].image[imageNumber].imageUrl;
imageParams.linkToOpen = mainObj.section[sectionNum].image[imageNumber].link;
return (imageParams);
} // End of the function
function checkLinkType(linkTextType, linkNumber)
{
k = 0;
typeCount = 0;
finalLinkNumber = parseInt(linkNumber) + 1;
currentPage = _root.link - _root.firstPageFrame;
sectionNum = getXmlSection(mainObj, "section", "pages");
for (linkTypeCkeck = mainObj.section[sectionNum].page[currentPage].link[k].linkType; linkTypeCkeck; linkTypeCkeck = mainObj.section[sectionNum].page[currentPage].link[k].linkType)
{
if (linkTypeCkeck == linkTextType)
{
++typeCount;
} // end if
if (typeCount == finalLinkNumber)
{
return (k);
break;
} // end if
++k;
} // end of for
} // End of the function
function more_click_func(number)
{
if (_root.my_flag == 1)
{
} // end if
tempNumber = number.split(" ");
number = tempNumber.join("");
number = number.toLowerCase();
num = _root.pagesReadMoreFrame;
currentPage = _root.link - _root.firstPageFrame;
if (isNaN(Number(number)))
{
readMoreType = number;
}
else
{
readMoreType = "readmore";
} // end else if
if ((_root.link != num || _root.readMoreFrameType != readMoreType) && _root.animation == 1)
{
_root.animation = 0;
_root.link_prev = _root.link;
if (_root.link != 6 && _root.my_flag != 1)
{
_root.menu["item" + getMenuPreviousLink(_root.link)].gotoAndPlay("s2");
_root.menu2["item" + getMenuPreviousLink(_root.link)].gotoAndPlay("s2");
} // end if
_root.plane_movs(_root.base_koord[0]);
if (number == "privacypolicy")
{
_root.readMoreFrameType = "privacypolicy";
sectionNum = getXmlSection(mainObj, "section", "privacyPolicy");
titleNum = getXmlSection(mainObj.section[sectionNum], "item", "pageTitle");
textNum = getXmlSection(mainObj.section[sectionNum], "item", "pageText");
_root.readMoreTitle = mainObj.section[sectionNum].item[titleNum].value;
_root.readMoreText = mainObj.section[sectionNum].item[textNum].value;
titleNum2 = getXmlSection(mainObj.section[sectionNum], "item", "pageTitle2");
textNum2 = getXmlSection(mainObj.section[sectionNum], "item", "pageText2");
_root.readMoreTitle2 = mainObj.section[sectionNum].item[titleNum2].value;
_root.readMoreText2 = mainObj.section[sectionNum].item[textNum2].value;
}
else if (number == "termsofuse")
{
_root.readMoreFrameType = "termsofuse";
sectionNum = getXmlSection(mainObj, "section", "termsOfUse");
titleNum = getXmlSection(mainObj.section[sectionNum], "item", "pageTitle");
textNum = getXmlSection(mainObj.section[sectionNum], "item", "pageText");
_root.readMoreTitle = mainObj.section[sectionNum].item[titleNum].value;
_root.readMoreText = mainObj.section[sectionNum].item[textNum].value;
titleNum2 = getXmlSection(mainObj.section[sectionNum], "item", "pageTitle2");
textNum2 = getXmlSection(mainObj.section[sectionNum], "item", "pageText2");
_root.readMoreTitle2 = mainObj.section[sectionNum].item[titleNum2].value;
_root.readMoreText2 = mainObj.section[sectionNum].item[textNum2].value;
}
else
{
_root.readMoreFrameType = "readmore";
sectionNum = getXmlSection(mainObj, "section", "pages");
linkCount = checkLinkType("readMoreLink", number);
i = 0;
linkTitleNum = getXmlSection(mainObj.section[sectionNum].page[currentPage].link[linkCount], "item", "title");
linkTextNum = getXmlSection(mainObj.section[sectionNum].page[currentPage].link[linkCount], "item", "linkText");
_root.readMoreTitle = mainObj.section[sectionNum].page[currentPage].link[linkCount].item[linkTitleNum].value;
_root.readMoreText = mainObj.section[sectionNum].page[currentPage].link[linkCount].item[linkTextNum].value;
linkTitleNum2 = getXmlSection(mainObj.section[sectionNum].page[currentPage].link[linkCount], "item", "title2");
linkTextNum2 = getXmlSection(mainObj.section[sectionNum].page[currentPage].link[linkCount], "item", "linkText2");
_root.readMoreTitle2 = mainObj.section[sectionNum].page[currentPage].link[linkCount].item[linkTitleNum2].value;
_root.readMoreText2 = mainObj.section[sectionNum].page[currentPage].link[linkCount].item[linkTextNum2].value;
} // end else if
_root.link = num;
_root.play();
} // end if
} // End of the function
function getContactFormText(textObj, textNumber)
{
sectionNum = getXmlSection(mainObj, "section", "contactForm");
textObj.htmlText = mainObj.section[sectionNum].texts[0].pageText[textNumber].value;
textSelectable(textObj);
} // End of the function
function getContactFormText_only(textNumber)
{
sectionNum = getXmlSection(mainObj, "section", "contactForm");
return (htmlText = mainObj.section[sectionNum].texts[0].pageText[textNumber].value);
} // End of the function
function getContactFormParams()
{
sectionNum = getXmlSection(mainObj, "section", "contactForm");
ContactFormParams = new Array();
servNum = getXmlSection(mainObj.section[sectionNum], "item", "serverOption");
recNum = getXmlSection(mainObj.section[sectionNum], "item", "recipient");
ContactFormParams.rec = mainObj.section[sectionNum].item[recNum].value;
ContactFormParams.serv = mainObj.section[sectionNum].item[servNum].value;
return (ContactFormParams);
} // End of the function
function getGallerySystemProperty(propName)
{
sectionNum = getXmlSection(galleryObj, "section", "systemOptions");
propNum = getXmlSection(galleryObj.section[sectionNum], "option", propName);
return (galleryObj.section[sectionNum].option[propNum].value);
} // End of the function
function getGallerySettings(propName)
{
sectionNum = getXmlSection(galleryObj, "section", "settings");
propNum = getXmlSection(galleryObj.section[sectionNum], "option", propName);
return (galleryObj.section[sectionNum].option[propNum].value);
} // End of the function
function getGalleryImage(imageNum, categoryNum)
{
sectionNum = getXmlSection(galleryObj, "section", "imagesData");
imageParams = new Array();
image = galleryObj.section[sectionNum].category[categoryNum].image[imageNum];
nameNum = getXmlSection(image, "item", "imageUrl");
commentNum = getXmlSection(image, "item", "imageComment");
imageParams.name = image.item[nameNum].value;
imageParams.comment = image.item[commentNum].value;
return (imageParams);
} // End of the function
function getCurrentGalleryName(categoryNum)
{
sectionNum = getXmlSection(galleryObj, "section", "imagesData");
return (galleryObj.section[sectionNum].category[categoryNum].name);
} // End of the function
searchResultsFrame = 6;
pagesReadMoreFrame = 5;
firstPageFrame = 1;
var mainObj = _root.parsed_obj;
var galleryObj = _root.gallery_obj;
_root.readMoreFrameType = "readmore";





Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]