1 / 6
Jun 2009

I need help with the fade-in overlay cart effect from an xml file.



I have an xml Flash mp3 player. The xml file is being called from an swf (Flash) file embedded in my HTML page.



This is the xml file:



<setting mode="normal" allowDrag="false" allowDoubleClickToSwitchMode="false" showPlaylist="true" autoPlay="true" loop="true" shuffle="false" volume="75" mute="false">

<audio cover="mp3-player/files/TataCover.jpg" singer="Táta Vega" album="This Joy" song="This Joy" url="mp3-player/files/This_Joy.mp3"

link="https://www.e-junkie.com/ecom/gb.php?c=cart&i=DRR-TV0110&cl=58192&ejc=2" linkTarget="ejejc" class="ec_ejc_thkbx"

onClick="javascript:return EJEJC_lc(this);" img="imgs/add_to_cart.jpg"/>



</setting>





I want to be able to get the fade-in overlay cart when I click the BUY button but I can only get it to open a new tab/window.







Can this be done? Am I missing some extra code somewhere?

  • created

    Jun '09
  • last reply

    Jul '09
  • 5

    replies

  • 1.2k

    views

  • 2

    users

  • 6

    links

Please see our Flash developer help page here:

http://www.e-junkie.com/ej/help.flash-shopping-cart.htm



Note that you will need to use Add to Cart/View Cart code to use the nice overlay cart, as the Buy Now code bypasses the cart entirely and takes a buyer directly to checkout for a single item at a time.



I think perhaps you are just missing the View Cart code in the source code of your Web page? You don't even need the actual button link, just so long as you have the last half with lines from the first <script... to the last </script>.

All you should need to do is make sure the actual Web page where the Flash is embedded includes the following lines of the View Cart code in the page's HTML -- these lines are required to generate the cart-overlay display from that page:



<script language="javascript" type="text/javascript">

<!--

function EJEJC_lc(th) { return false; }

// -->

</script>

<script type="text/javascript" src="https://www.e-junkie.com/ecom/box.js"></script>



...and also make sure your Flash content is embedded as "transparent", so the cart can "show through" the Flash when it's displayed (this prevents the Flash player from covering up the cart display). This is described at the top of the Flash help page I linked previously.

Tried it and still nothing. I think the required javascript is not being seen by the external xml file so it's not executing the



<script language="javascript" type="text/javascript">

<!--

function EJEJC_lc(th) { return false; }

// -->

</script>

<script type="text/javascript" src="https://www.e-junkie.com/ecom/box.js"></script>







This is the xml file:



<setting mode="normal" allowDrag="false" allowDoubleClickToSwitchMode="false" showPlaylist="true" autoPlay="true" loop="true" shuffle="false" volume="75" mute="false">

<audio cover="mp3-player/files/TataCover.jpg" singer="Táta Vega" album="This Joy" song="This Joy" url="mp3-player/files/This_Joy.mp3"

link="https://www.e-junkie.com/ecom/gb.php?c=cart&i=DRR-TV0110&cl=58192& ejc=2" linkTarget="ejejc" class="ec_ejc_thkbx"

onClick="javascript:return EJEJC_lc(this);" img="imgs/add_to_cart.jpg"/>



</setting>





Since I can't put the JS in the xml file is there any other way the xml file can see the required JS that's on the HTML so it can run it?

Okay, so essentially you would want to replace the link= URL you have:



1https://www.e-junkie.com/ecom/gb.php?c=cart&i=DRR-TV0110&cl=58192&ejc=21



...with this instead:



javascript:EJEJC_lc('1https://www.e-junkie.com/ecom/gb.php?c=cart&i=DRR-TV0110&cl=58192&ejc=21')



So your XML file would look something like this:



<setting mode="normal" allowDrag="false" allowDoubleClickToSwitchMode="false" showPlaylist="true" autoPlay="true" loop="true" shuffle="false" volume="75" mute="false">

<audio cover="mp3-player/files/TataCover.jpg" singer="Táta Vega" album="This Joy" song="This Joy" url="mp3-player/files/This_Joy.mp3" link="javascript:EJEJC_lc('1https://www.e-junkie.com/ecom/gb.php?c=cart&i=DRR-TV0110&cl=58192&ejc=21')" img="imgs/addto_cart.jpg"/>

</setting>



(Note I have also removed the linkTarget= and class= attributes, as they are not needed in this case.)