  | | | Re: problem with opening an anchor link from flash | Re: problem with opening an anchor link from flash 2006-09-01 - By Michele | DesignZoo
Back okay this is how i'd solve it : in the head of the page (or in an external .js file) you place this javascript code: ================= JAVASCRIPT =========================== function scrollPage(myElementId){ if(myElementId != null && myElementId != ''){ myElement = document.getElementById(myElementId); myElementY = findPosY(myElement); scrollTarget = myElementY-40 (See http://ntY-40.ora-code.com); } }
function findPosY(obj) { if (obj != null) { var curtop = 0; if (obj.offsetParent) { while (obj.offsetParent) { curtop += obj.offsetTop obj = obj.offsetParent; } } else if (obj.y) curtop += obj.y; return curtop; } }
function findPosX(obj) { var curleft = 0; if (obj.offsetParent) { while (obj.offsetParent) { curleft += obj.offsetLeft obj = obj.offsetParent; } } else if (obj.x) curleft += obj.x; return curleft; } ================ end of js code ===================
then in within flash you call teh function as i wrote before: getURL('javascript:scrollPage(Anchor_ID))
obviously you have to define the anchor id on the html page!
hey let me know if it works!! i might use it one day if it does!
Michele La Corte www.designzoo.it www.aedo.it
-- -- Original Message -- -- From: Michele | DesignZoo To: pro_flash@(protected) Sent: Friday, September 01, 2006 8:12 PM Subject: Re: [Pro Flash Users] Re: problem with opening an anchor link from flash
i bet you could use some javascript in this to solve the problem. i think you only need to define a javascript where you place the action that moves the page to the desired "anchor". maybe like this: <script language="javascript"> function MovePageToAnchor(){ //the script needed } </script>
after that all you need to do is call that javascript from within flash: getURL('javascript:MovePageToAnchor()')
why not? uh?
Michele La Corte www.designzoo.it www.aedo.it
-- -- Original Message -- -- From: alikim2007 To: pro_flash@(protected) Sent: Friday, September 01, 2006 10:03 AM Subject: [Pro Flash Users] Re: problem with opening an anchor link from flash
I can't still resolve this problem. Has anyone faced it before?
> Hello all, > > I have an html page with a flash object on it. The flash contains > a button > with the following AC placed at the button's frame: > > but.onRelease = function() { > getURL("promo.htm#anchor", "_self"); > }; > > so the idea is simply to open promo.htm at the anchor point. > > The problem is in following: when I place files on my D:/ and click > the button in Firefox it works perfectly but when I place files on my > flash disc it opens only "promo.htm" w/o anchor. > In MSIE the button always opens page w/o anchor. > > Actually, I have two questions: first, why isn't it always working? > and second, what can I do here? (mind that I can not use javascript) > > Any help will be appreciated, > alikim
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
========================= Pro_Flash: Professional Web Developers Using Macromedia Flash To subscribe: mailto:pro_flash-subscribe@(protected) To UNSUBSCRIBE: mailto:pro_flash-unsubscribe@(protected) Yahoo! Groups Links
<*> To visit your group on the web, go to: http://groups.yahoo.com/group/pro_flash/
<*> To unsubscribe from this group, send an email to: pro_flash-unsubscribe@(protected)
<*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
|
|
 |